Selecciona un archivo...

404

This page could not be found.

"},{"name":"absences.html","path":"apps/web/out/admin/absences.html","area":"FRONTEND","folder":"ADMIN","content":"

Gestión de Ausencias

Módulo restaurado. Cargando datos...

"},{"name":"audit.html","path":"apps/web/out/admin/audit.html","area":"FRONTEND","folder":"ADMIN","content":"

Auditoría de Sistema

Registros de Actividad

Historial completo de acciones realizadas en la plataforma

0 Registros
Fecha / HoraUsuarioAcciónMódulo
No se encontraron registros de actividad
"},{"name":"new.html","path":"apps/web/out/admin/clients/new.html","area":"FRONTEND","folder":"CLIENTS","content":"

Verificando permisos...

"},{"name":"clients.html","path":"apps/web/out/admin/clients.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"dashboard.html","path":"apps/web/out/admin/dashboard.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"employees.html","path":"apps/web/out/admin/employees.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"home.html","path":"apps/web/out/admin/home.html","area":"FRONTEND","folder":"ADMIN","content":"

Centro de Mando

COBERTURA

0%

VACANTES

0

PERSONAL

0

LICENCIAS

0

Monitor Operativo

La infraestructura de CronoApp se encuentra sincronizada con el motor de Google Firebase.

Sistema en línea
"},{"name":"labor-agreements.html","path":"apps/web/out/admin/labor-agreements.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"[id].html","path":"apps/web/out/admin/objective-detail/[id].html","area":"FRONTEND","folder":"OBJECTIVE-DETAIL","content":"

Verificando permisos...

"},{"name":"objective-management.html","path":"apps/web/out/admin/objective-management.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"objectives.html","path":"apps/web/out/admin/objectives.html","area":"FRONTEND","folder":"ADMIN","content":"

Gestión de Objetivos

Módulo restaurado. Cargando datos...

"},{"name":"map.html","path":"apps/web/out/admin/operations/map.html","area":"FRONTEND","folder":"OPERATIONS","content":"

Verificando permisos...

"},{"name":"gantt.html","path":"apps/web/out/admin/planning/gantt.html","area":"FRONTEND","folder":"PLANNING","content":"

Verificando permisos...

"},{"name":"matrix.html","path":"apps/web/out/admin/planning/matrix.html","area":"FRONTEND","folder":"PLANNING","content":"

Matriz de Planificación

DIC 15 - 21
Objetivo / Puesto de Servicio

lun

15

mar

16

mié

17

jue

18

vie

19

sáb

20

dom

21

Por favor, selecciona una empresa para ver la matriz.

"},{"name":"novedades.html","path":"apps/web/out/admin/rrhh/novedades.html","area":"FRONTEND","folder":"RRHH","content":"

Verificando permisos...

"},{"name":"status.html","path":"apps/web/out/admin/status.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"system-users.html","path":"apps/web/out/admin/system-users.html","area":"FRONTEND","folder":"ADMIN","content":"

Verificando permisos...

"},{"name":"dashboard.html","path":"apps/web/out/employee/dashboard.html","area":"FRONTEND","folder":"EMPLOYEE","content":"

Verificando permisos...

"},{"name":"employees.html","path":"apps/web/out/employee/employees.html","area":"FRONTEND","folder":"EMPLOYEE","content":"

Verificando permisos...

"},{"name":"index.html","path":"apps/web/out/index.html","area":"FRONTEND","folder":"OUT","content":"
"},{"name":"login.html","path":"apps/web/out/login.html","area":"FRONTEND","folder":"OUT","content":"

CRONOAPP

Ingresa a tu centro de mando

"},{"name":"_buildManifest.js","path":"apps/web/out/_next/static/cBZS6ToFEPNJsPdaNARFa/_buildManifest.js","area":"FRONTEND","folder":"CBZS6TOFEPNJSPDANARFA","content":"self.__BUILD_MANIFEST=function(a,s,e,n,i,t,c){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:0,errorRate:1e-4,numBits:0,numHashes:n,bitArray:[]},__routerFilterDynamic:{numItems:0,errorRate:1e-4,numBits:0,numHashes:n,bitArray:[]},\\"/\\":[\\"static/chunks/pages/index-ace76fcf5791b85b.js\\"],\\"/_error\\":[\\"static/chunks/pages/_error-de1c64435fe2d9b7.js\\"],\\"/admin/absences\\":[a,\\"static/chunks/pages/admin/absences-5726e3e6753ac41c.js\\"],\\"/admin/audit\\":[a,i,\\"static/chunks/pages/admin/audit-e2865bcee48bd6aa.js\\"],\\"/admin/clients\\":[a,\\"static/chunks/pages/admin/clients-7342ef5d0ed6345c.js\\"],\\"/admin/clients/new\\":[a,\\"static/chunks/pages/admin/clients/new-98cb870bd8339a29.js\\"],\\"/admin/dashboard\\":[a,t,\\"static/chunks/571-745635c4fdfc1dcf.js\\",\\"static/chunks/pages/admin/dashboard-d89e3d0de3e9d259.js\\"],\\"/admin/employees\\":[a,c,\\"static/chunks/pages/admin/employees-dc4f1368b4c660b1.js\\"],\\"/admin/home\\":[a,\\"static/chunks/pages/admin/home-df25a8b2d171f753.js\\"],\\"/admin/labor-agreements\\":[a,\\"static/chunks/pages/admin/labor-agreements-d4eaae60c15494a8.js\\"],\\"/admin/objective-detail/[id]\\":[a,\\"static/chunks/pages/admin/objective-detail/[id]-29fc8b3f69e6d8e9.js\\"],\\"/admin/objective-management\\":[a,\\"static/css/817861b3084ec298.css\\",\\"static/chunks/pages/admin/objective-management-9c2bca88c6a719f3.js\\"],\\"/admin/objectives\\":[a,\\"static/chunks/pages/admin/objectives-3041285ee9b1a504.js\\"],\\"/admin/operations/map\\":[\\"static/chunks/e098907b-6340bd47700d3b58.js\\",a,\\"static/chunks/pages/admin/operations/map-510156ae87b18b3d.js\\"],\\"/admin/planning/gantt\\":[a,t,\\"static/chunks/pages/admin/planning/gantt-9521b99e391eb0b5.js\\"],\\"/admin/planning/matrix\\":[a,i,\\"static/chunks/pages/admin/planning/matrix-c650b44ab7c61c72.js\\"],\\"/admin/rrhh/novedades\\":[a,\\"static/chunks/pages/admin/rrhh/novedades-e18eba8670348a32.js\\"],\\"/admin/status\\":[a,\\"static/chunks/pages/admin/status-ebecaf38c9e75599.js\\"],\\"/admin/system-users\\":[a,\\"static/chunks/pages/admin/system-users-6abb74606cff7624.js\\"],\\"/employee/dashboard\\":[\\"static/chunks/pages/employee/dashboard-5075a1c18c2daeb1.js\\"],\\"/employee/employees\\":[a,c,\\"static/chunks/pages/employee/employees-d41dc32db766af7f.js\\"],\\"/login\\":[\\"static/chunks/pages/login-a14fc515881e0b30.js\\"],sortedPages:[\\"/\\",\\"/_app\\",\\"/_error\\",\\"/admin/absences\\",\\"/admin/audit\\",\\"/admin/clients\\",\\"/admin/clients/new\\",\\"/admin/dashboard\\",\\"/admin/employees\\",\\"/admin/home\\",\\"/admin/labor-agreements\\",\\"/admin/objective-detail/[id]\\",\\"/admin/objective-management\\",\\"/admin/objectives\\",\\"/admin/operations/map\\",\\"/admin/planning/gantt\\",\\"/admin/planning/matrix\\",\\"/admin/rrhh/novedades\\",\\"/admin/status\\",\\"/admin/system-users\\",\\"/employee/dashboard\\",\\"/employee/employees\\",\\"/login\\"]}}(\\"static/chunks/212-7d587399cfb93531.js\\",0,0,NaN,\\"static/chunks/914-a17084a0d0a25720.js\\",\\"static/chunks/858-d1b1e4747ce15efa.js\\",\\"static/chunks/995-84db8fe815cc0d4b.js\\"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();"},{"name":"_ssgManifest.js","path":"apps/web/out/_next/static/cBZS6ToFEPNJsPdaNARFa/_ssgManifest.js","area":"FRONTEND","folder":"CBZS6TOFEPNJSPDANARFA","content":"self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB();"},{"name":"212-7d587399cfb93531.js","path":"apps/web/out/_next/static/chunks/212-7d587399cfb93531.js","area":"FRONTEND","folder":"CHUNKS","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[212],{301:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"useIntersection\\",{enumerable:!0,get:function(){return c}});let l=r(4232),n=r(2640),a=\\"function\\"==typeof IntersectionObserver,u=new Map,o=[];function c({rootRef:e,rootMargin:t,disabled:r}){let c=r||!a,[i,s]=(0,l.useState)(!1),f=(0,l.useRef)(null),d=(0,l.useCallback)(e=>{f.current=e},[]);return(0,l.useEffect)(()=>{if(a){if(c||i)return;let r=f.current;if(r&&r.tagName)return function(e,t,r){let{id:l,observer:n,elements:a}=function(e){let t,r={root:e.root||null,margin:e.rootMargin||\\"\\"},l=o.find(e=>e.root===r.root&&e.margin===r.margin);if(l&&(t=u.get(l)))return t;let n=new Map;return t={id:r,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=n.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e),elements:n},o.push(r),u.set(r,t),t}(r);return a.set(e,t),n.observe(e),function(){if(a.delete(e),n.unobserve(e),0===a.size){n.disconnect(),u.delete(l);let e=o.findIndex(e=>e.root===l.root&&e.margin===l.margin);e>-1&&o.splice(e,1)}}}(r,e=>e&&s(e),{root:e?.current,rootMargin:t})}else if(!i){let e=(0,n.requestIdleCallback)(()=>s(!0));return()=>(0,n.cancelIdleCallback)(e)}},[c,t,e,i,f.current]),[d,i,(0,l.useCallback)(()=>{s(!1)},[])]}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1538:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"users\\",[[\\"path\\",{d:\\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\\",key:\\"1yyitq\\"}],[\\"path\\",{d:\\"M16 3.128a4 4 0 0 1 0 7.744\\",key:\\"16gr8j\\"}],[\\"path\\",{d:\\"M22 21v-2a4 4 0 0 0-3-3.87\\",key:\\"kshegd\\"}],[\\"circle\\",{cx:\\"9\\",cy:\\"7\\",r:\\"4\\",key:\\"nufk8\\"}]])},3657:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"log-out\\",[[\\"path\\",{d:\\"m16 17 5-5-5-5\\",key:\\"1bji2h\\"}],[\\"path\\",{d:\\"M21 12H9\\",key:\\"dn1m92\\"}],[\\"path\\",{d:\\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\\",key:\\"1uf3rs\\"}]])},3872:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"useMergedRef\\",{enumerable:!0,get:function(){return n}});let l=r(4232);function n(e,t){let r=(0,l.useRef)(null),n=(0,l.useRef)(null);return(0,l.useCallback)(l=>{if(null===l){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=a(e,l)),t&&(n.current=a(t,l))},[e,t])}function a(e,t){if(\\"function\\"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return\\"function\\"==typeof r?r:()=>e(null)}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3966:(e,t,r)=>{\\"use strict\\";function l(e,t,r,l){return!1}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"getDomainLocale\\",{enumerable:!0,get:function(){return l}}),r(6720),(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4302:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"house\\",[[\\"path\\",{d:\\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\\",key:\\"5wwlr5\\"}],[\\"path\\",{d:\\"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\\",key:\\"r6nss1\\"}]])},4560:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"user-x\\",[[\\"path\\",{d:\\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\\",key:\\"1yyitq\\"}],[\\"circle\\",{cx:\\"9\\",cy:\\"7\\",r:\\"4\\",key:\\"nufk8\\"}],[\\"line\\",{x1:\\"17\\",x2:\\"22\\",y1:\\"8\\",y2:\\"13\\",key:\\"3nzzx3\\"}],[\\"line\\",{x1:\\"22\\",x2:\\"17\\",y1:\\"8\\",y2:\\"13\\",key:\\"1swrse\\"}]])},4763:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"target\\",[[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"6\\",key:\\"1vlfrh\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"2\\",key:\\"1c9p78\\"}]])},5164:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"chevron-down\\",[[\\"path\\",{d:\\"m6 9 6 6 6-6\\",key:\\"qrunsl\\"}]])},5201:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"zap\\",[[\\"path\\",{d:\\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\\",key:\\"1xq2db\\"}]])},6068:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"shield-alert\\",[[\\"path\\",{d:\\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\\",key:\\"oel41y\\"}],[\\"path\\",{d:\\"M12 8v4\\",key:\\"1got3b\\"}],[\\"path\\",{d:\\"M12 16h.01\\",key:\\"1drbdi\\"}]])},6334:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var l={default:function(){return _},useLinkStatus:function(){return A}};for(var n in l)Object.defineProperty(t,n,{enumerable:!0,get:l[n]});let a=r(8365),u=r(7876),o=a._(r(4232)),c=r(5948),i=r(2454),s=r(7855),f=r(9313),d=r(1162),p=r(5067),y=r(301),h=r(3966),k=r(3467),b=r(3872);r(6642);let v=new Set;function g(e,t,r,l){if((0,i.isLocalURL)(t)){if(!l.bypassPrefetchedCheck){let n=t+\\"%\\"+r+\\"%\\"+(void 0!==l.locale?l.locale:\\"locale\\"in e?e.locale:void 0);if(v.has(n))return;v.add(n)}e.prefetch(t,r,l).catch(e=>{})}}function M(e){return\\"string\\"==typeof e?e:(0,s.formatUrl)(e)}let x=o.default.forwardRef(function(e,t){let r,l,{href:n,as:a,children:s,prefetch:v=null,passHref:x,replace:m,shallow:A,scroll:_,locale:w,onClick:j,onNavigate:C,onMouseEnter:O,onTouchStart:P,legacyBehavior:L=!1,...E}=e;r=s,L&&(\\"string\\"==typeof r||\\"number\\"==typeof r)&&(r=(0,u.jsx)(\\"a\\",{children:r}));let R=o.default.useContext(p.RouterContext),z=!1!==v,{href:H,as:I}=o.default.useMemo(()=>{if(!R){let e=M(n);return{href:e,as:a?M(a):e}}let[e,t]=(0,c.resolveHref)(R,n,!0);return{href:e,as:a?(0,c.resolveHref)(R,a):t||e}},[R,n,a]),N=o.default.useRef(H),S=o.default.useRef(I);L&&(l=o.default.Children.only(r));let T=L?l&&\\"object\\"==typeof l&&l.ref:t,[U,D,q]=(0,y.useIntersection)({rootMargin:\\"200px\\"}),K=o.default.useCallback(e=>{(S.current!==I||N.current!==H)&&(q(),S.current=I,N.current=H),U(e)},[I,H,q,U]),V=(0,b.useMergedRef)(K,T);o.default.useEffect(()=>{!R||D&&z&&g(R,H,I,{locale:w})},[I,H,D,w,z,R?.locale,R]);let $={ref:V,onClick(e){L||\\"function\\"!=typeof j||j(e),L&&l.props&&\\"function\\"==typeof l.props.onClick&&l.props.onClick(e),!R||e.defaultPrevented||function(e,t,r,l,n,a,u,o,c){let s,{nodeName:f}=e.currentTarget;if(!(\\"A\\"===f.toUpperCase()&&((s=e.currentTarget.getAttribute(\\"target\\"))&&\\"_self\\"!==s||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute(\\"download\\"))){if(!(0,i.isLocalURL)(r)){n&&(e.preventDefault(),location.replace(r));return}e.preventDefault(),(()=>{if(c){let e=!1;if(c({preventDefault:()=>{e=!0}}),e)return}let e=u??!0;\\"beforePopState\\"in t?t[n?\\"replace\\":\\"push\\"](r,l,{shallow:a,locale:o,scroll:e}):t[n?\\"replace\\":\\"push\\"](l||r,{scroll:e})})()}}(e,R,H,I,m,A,_,w,C)},onMouseEnter(e){L||\\"function\\"!=typeof O||O(e),L&&l.props&&\\"function\\"==typeof l.props.onMouseEnter&&l.props.onMouseEnter(e),R&&g(R,H,I,{locale:w,priority:!0,bypassPrefetchedCheck:!0})},onTouchStart:function(e){L||\\"function\\"!=typeof P||P(e),L&&l.props&&\\"function\\"==typeof l.props.onTouchStart&&l.props.onTouchStart(e),R&&g(R,H,I,{locale:w,priority:!0,bypassPrefetchedCheck:!0})}};if((0,f.isAbsoluteUrl)(I))$.href=I;else if(!L||x||\\"a\\"===l.type&&!(\\"href\\"in l.props)){let e=void 0!==w?w:R?.locale;$.href=R?.isLocaleDomain&&(0,h.getDomainLocale)(I,e,R?.locales,R?.domainLocales)||(0,k.addBasePath)((0,d.addLocale)(I,e,R?.defaultLocale))}return L?o.default.cloneElement(l,$):(0,u.jsx)(\\"a\\",{...E,...$,children:r})}),m=(0,o.createContext)({pending:!1}),A=()=>(0,o.useContext)(m),_=x;(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6642:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"errorOnce\\",{enumerable:!0,get:function(){return r}});let r=e=>{}},7161:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>c});var l=r(4232);let n=e=>{let t=e.replace(/^([A-Z])|[\\\\s-_]+(\\\\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},a=(...e)=>e.filter((e,t,r)=>!!e&&\\"\\"!==e.trim()&&r.indexOf(e)===t).join(\\" \\").trim();var u={xmlns:\\"http://www.w3.org/2000/svg\\",width:24,height:24,viewBox:\\"0 0 24 24\\",fill:\\"none\\",stroke:\\"currentColor\\",strokeWidth:2,strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\"};let o=(0,l.forwardRef)(({color:e=\\"currentColor\\",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o=\\"\\",children:c,iconNode:i,...s},f)=>(0,l.createElement)(\\"svg\\",{ref:f,...u,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:a(\\"lucide\\",o),...!c&&!(e=>{for(let t in e)if(t.startsWith(\\"aria-\\")||\\"role\\"===t||\\"title\\"===t)return!0})(s)&&{\\"aria-hidden\\":\\"true\\"},...s},[...i.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(c)?c:[c]])),c=(e,t)=>{let r=(0,l.forwardRef)(({className:r,...u},c)=>(0,l.createElement)(o,{ref:c,iconNode:t,className:a(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,\\"$1-$2\\").toLowerCase()}`,`lucide-${e}`,r),...u}));return r.displayName=n(e),r}},8230:(e,t,r)=>{e.exports=r(6334)},8264:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"calendar\\",[[\\"path\\",{d:\\"M8 2v4\\",key:\\"1cmpym\\"}],[\\"path\\",{d:\\"M16 2v4\\",key:\\"4m81vk\\"}],[\\"rect\\",{width:\\"18\\",height:\\"18\\",x:\\"3\\",y:\\"4\\",rx:\\"2\\",key:\\"1hopcy\\"}],[\\"path\\",{d:\\"M3 10h18\\",key:\\"8toen8\\"}]])},8423:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"activity\\",[[\\"path\\",{d:\\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\\",key:\\"169zse\\"}]])},9065:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"building-2\\",[[\\"path\\",{d:\\"M10 12h4\\",key:\\"a56b0p\\"}],[\\"path\\",{d:\\"M10 8h4\\",key:\\"1sr2af\\"}],[\\"path\\",{d:\\"M14 21v-3a2 2 0 0 0-4 0v3\\",key:\\"1rgiei\\"}],[\\"path\\",{d:\\"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2\\",key:\\"secmi2\\"}],[\\"path\\",{d:\\"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16\\",key:\\"16ra0t\\"}]])},9099:(e,t,r)=>{e.exports=r(9603)},9423:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>l});let l=(0,r(7161).A)(\\"layout-grid\\",[[\\"rect\\",{width:\\"7\\",height:\\"7\\",x:\\"3\\",y:\\"3\\",rx:\\"1\\",key:\\"1g98yp\\"}],[\\"rect\\",{width:\\"7\\",height:\\"7\\",x:\\"14\\",y:\\"3\\",rx:\\"1\\",key:\\"6d4xhi\\"}],[\\"rect\\",{width:\\"7\\",height:\\"7\\",x:\\"14\\",y:\\"14\\",rx:\\"1\\",key:\\"nxv5o0\\"}],[\\"rect\\",{width:\\"7\\",height:\\"7\\",x:\\"3\\",y:\\"14\\",rx:\\"1\\",key:\\"1bb6yr\\"}]])}}]);"},{"name":"494.0bfdf534d4777fad.js","path":"apps/web/out/_next/static/chunks/494.0bfdf534d4777fad.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[494],{5494:(e,t,n)=>{Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return h}});let r=n(4252),o=n(7876),a=r._(n(4232)),i=r._(n(8022)),l={400:\\"Bad Request\\",404:\\"This page could not be found\\",405:\\"Method Not Allowed\\",500:\\"Internal Server Error\\"};function d({req:e,res:t,err:n}){return{statusCode:t&&t.statusCode?t.statusCode:n?n.statusCode:404,hostname:window.location.hostname}}let s={fontFamily:\'system-ui,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif,\\"Apple Color Emoji\\",\\"Segoe UI Emoji\\"\',height:\\"100vh\\",textAlign:\\"center\\",display:\\"flex\\",flexDirection:\\"column\\",alignItems:\\"center\\",justifyContent:\\"center\\"},u={lineHeight:\\"48px\\"},c={display:\\"inline-block\\",margin:\\"0 20px 0 0\\",paddingRight:23,fontSize:24,fontWeight:500,verticalAlign:\\"top\\"},f={fontSize:14,fontWeight:400,lineHeight:\\"28px\\"},p={display:\\"inline-block\\"};class h extends a.default.Component{static{this.displayName=\\"ErrorPage\\"}static{this.getInitialProps=d}static{this.origGetInitialProps=d}render(){let{statusCode:e,withDarkMode:t=!0}=this.props,n=this.props.title||l[e]||\\"An unexpected error has occurred\\";return(0,o.jsxs)(\\"div\\",{style:s,children:[(0,o.jsx)(i.default,{children:(0,o.jsx)(\\"title\\",{children:e?`${e}: ${n}`:\\"Application error: a client-side exception has occurred\\"})}),(0,o.jsxs)(\\"div\\",{style:u,children:[(0,o.jsx)(\\"style\\",{dangerouslySetInnerHTML:{__html:`body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}${t?\\"@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\\":\\"\\"}`}}),e?(0,o.jsx)(\\"h1\\",{className:\\"next-error-h1\\",style:c,children:e}):null,(0,o.jsx)(\\"div\\",{style:p,children:(0,o.jsxs)(\\"h2\\",{style:f,children:[this.props.title||e?n:(0,o.jsxs)(o.Fragment,{children:[\\"Application error: a client-side exception has occurred\\",\\" \\",!!this.props.hostname&&(0,o.jsxs)(o.Fragment,{children:[\\"while loading \\",this.props.hostname]}),\\" \\",\\"(see the browser console for more information)\\"]}),\\".\\"]})})]})]})}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8022:(e,t,n)=>{Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={default:function(){return y},defaultHead:function(){return c}};for(var o in r)Object.defineProperty(t,o,{enumerable:!0,get:r[o]});let a=n(4252),i=n(8365),l=n(7876),d=i._(n(4232)),s=a._(n(8071)),u=n(6972);function c(){return[(0,l.jsx)(\\"meta\\",{charSet:\\"utf-8\\"},\\"charset\\"),(0,l.jsx)(\\"meta\\",{name:\\"viewport\\",content:\\"width=device-width\\"},\\"viewport\\")]}function f(e,t){return\\"string\\"==typeof t||\\"number\\"==typeof t?e:t.type===d.default.Fragment?e.concat(d.default.Children.toArray(t.props.children).reduce((e,t)=>\\"string\\"==typeof t||\\"number\\"==typeof t?e:e.concat(t),[])):e.concat(t)}n(8912);let p=[\\"name\\",\\"httpEquiv\\",\\"charSet\\",\\"itemProp\\"];function h(e){let t,n,r,o;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,n=new Set,r=new Set,o={},e=>{let a=!0,i=!1;if(e.key&&\\"number\\"!=typeof e.key&&e.key.indexOf(\\"$\\")>0){i=!0;let n=e.key.slice(e.key.indexOf(\\"$\\")+1);t.has(n)?a=!1:t.add(n)}switch(e.type){case\\"title\\":case\\"base\\":n.has(e.type)?a=!1:n.add(e.type);break;case\\"meta\\":for(let t=0,n=p.length;t{let n=e.key||t;return d.default.cloneElement(e,{key:n})})}let y=function({children:e}){let t=(0,d.useContext)(u.HeadManagerContext);return(0,l.jsx)(s.default,{reduceComponentsToState:h,headManager:t,children:e})};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8071:(e,t,n)=>{Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return i}});let r=n(4232),o=r.useLayoutEffect,a=r.useEffect;function i(e){let{headManager:t,reduceComponentsToState:n}=e;function i(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return o(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),o(()=>(t&&(t._pendingUpdate=i),()=>{t&&(t._pendingUpdate=i)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}}}]);"},{"name":"571-745635c4fdfc1dcf.js","path":"apps/web/out/_next/static/chunks/571-745635c4fdfc1dcf.js","area":"FRONTEND","folder":"CHUNKS","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[571],{129:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"circle-alert\\",[[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}],[\\"line\\",{x1:\\"12\\",x2:\\"12\\",y1:\\"8\\",y2:\\"12\\",key:\\"1pkeuh\\"}],[\\"line\\",{x1:\\"12\\",x2:\\"12.01\\",y1:\\"16\\",y2:\\"16\\",key:\\"4dfq90\\"}]])},212:(e,t,r)=>{\\"use strict\\";function o(){for(var e,t,r=0,o=\\"\\",a=arguments.length;ro})},457:(e,t,r)=>{\\"use strict\\";r.d(t,{g:()=>a});var o=r(8333);function a(e,t,r){let a=(0,o.a)(e,r?.in);return a.setMinutes(t),a}},505:(e,t,r)=>{\\"use strict\\";r.d(t,{a:()=>a});var o=r(4144);function a(e,t,r){return(0,o.P)(e,-t,r)}},2283:(e,t,r)=>{\\"use strict\\";r.d(t,{M:()=>l});var o=r(2146),a=r(7901),n=r(7941);function l(e,t,r){let[l,s]=(0,a.x)(r?.in,e,t),i=(l-s)/n.s0;return(0,o.u)(r?.roundingMethod)(i)}},2391:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"globe\\",[[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}],[\\"path\\",{d:\\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\\",key:\\"13o1zl\\"}],[\\"path\\",{d:\\"M2 12h20\\",key:\\"9i4pu4\\"}]])},2663:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"copy\\",[[\\"rect\\",{width:\\"14\\",height:\\"14\\",x:\\"8\\",y:\\"8\\",rx:\\"2\\",ry:\\"2\\",key:\\"17jyea\\"}],[\\"path\\",{d:\\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\\",key:\\"zix9uf\\"}]])},3144:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"arrow-right\\",[[\\"path\\",{d:\\"M5 12h14\\",key:\\"1ays0h\\"}],[\\"path\\",{d:\\"m12 5 7 7-7 7\\",key:\\"xquz4c\\"}]])},3626:(e,t,r)=>{\\"use strict\\";r.d(t,{D:()=>a});var o=r(8333);function a(e,t){let r=(0,o.a)(e,t?.in);return r.setHours(23,59,59,999),r}},4015:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"trash-2\\",[[\\"path\\",{d:\\"M10 11v6\\",key:\\"nco0om\\"}],[\\"path\\",{d:\\"M14 11v6\\",key:\\"outv1u\\"}],[\\"path\\",{d:\\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\\",key:\\"miytrc\\"}],[\\"path\\",{d:\\"M3 6h18\\",key:\\"d0wm0j\\"}],[\\"path\\",{d:\\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\\",key:\\"e791ji\\"}]])},4144:(e,t,r)=>{\\"use strict\\";r.d(t,{P:()=>n});var o=r(3921),a=r(8333);function n(e,t,r){let n=(0,a.a)(e,r?.in);if(isNaN(t))return(0,o.w)(r?.in||e,NaN);if(!t)return n;let l=n.getDate(),s=(0,o.w)(r?.in||e,n.getTime());return(s.setMonth(n.getMonth()+t+1,0),l>=s.getDate())?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}},4182:(e,t,r)=>{\\"use strict\\";r.d(t,{d:()=>a});var o=r(8333);function a(e,t){return+(0,o.a)(e)>+(0,o.a)(t)}},4734:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"refresh-cw\\",[[\\"path\\",{d:\\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\\",key:\\"v9h5vc\\"}],[\\"path\\",{d:\\"M21 3v5h-5\\",key:\\"1q7to0\\"}],[\\"path\\",{d:\\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\\",key:\\"3uifl3\\"}],[\\"path\\",{d:\\"M8 16H3v5\\",key:\\"1cv678\\"}]])},4908:(e,t,r)=>{\\"use strict\\";r.d(t,{z:()=>n});var o=r(7941),a=r(8333);function n(e,t,r){let n=(0,a.a)(e,r?.in);return n.setTime(n.getTime()+t*o.Cg),n}},5008:(e,t,r)=>{\\"use strict\\";r.d(t,{H:()=>l});var o=r(7941),a=r(3921),n=r(8333);function l(e,t){let r,l,h=()=>(0,a.w)(t?.in,NaN),y=t?.additionalDigits??2,k=function(e){let t,r={},o=e.split(s);if(o.length>2)return r;if(/:/.test(o[0])?t=o[0]:(r.date=o[0],t=o[1],i.test(r.date)&&(r.date=e.split(i)[0],t=e.substr(r.date.length,e.length))),t){let e=d.exec(t);e?(r.time=t.replace(e[1],\\"\\"),r.timezone=e[1]):r.time=t}return r}(e);if(k.date){let e=function(e,t){let r=RegExp(\\"^(?:(\\\\\\\\d{4}|[+-]\\\\\\\\d{\\"+(4+t)+\\"})|(\\\\\\\\d{2}|[+-]\\\\\\\\d{\\"+(2+t)+\\"})$)\\"),o=e.match(r);if(!o)return{year:NaN,restDateString:\\"\\"};let a=o[1]?parseInt(o[1]):null,n=o[2]?parseInt(o[2]):null;return{year:null===n?a:100*n,restDateString:e.slice((o[1]||o[2]).length)}}(k.date,y);r=function(e,t){var r,o,a,n,l,s,i,d,u,m;if(null===t)return new Date(NaN);let f=e.match(c);if(!f)return new Date(NaN);let h=!!f[4],y=p(f[1]),k=p(f[2])-1,w=p(f[3]),x=p(f[4]),v=p(f[5])-1;if(h){let e,s;return(r=x,o=v,r>=1&&r<=53&&o>=0&&o<=6)?(a=t,n=x,l=v,(e=new Date(0)).setUTCFullYear(a,0,4),s=e.getUTCDay()||7,e.setUTCDate(e.getUTCDate()+((n-1)*7+l+1-s)),e):new Date(NaN)}{let e=new Date(0);return(s=t,i=k,d=w,i>=0&&i<=11&&d>=1&&d<=(g[i]||(b(s)?29:28))&&(u=t,(m=y)>=1&&m<=(b(u)?366:365)))?(e.setUTCFullYear(t,k,Math.max(y,w)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!r||isNaN(+r))return h();let w=+r,x=0;if(k.time&&isNaN(x=function(e){var t,r,a;let n=e.match(u);if(!n)return NaN;let l=f(n[1]),s=f(n[2]),i=f(n[3]);return(t=l,r=s,a=i,24===t?0===r&&0===a:a>=0&&a<60&&r>=0&&r<60&&t>=0&&t<25)?l*o.s0+s*o.Cg+1e3*i:NaN}(k.time)))return h();if(k.timezone){if(isNaN(l=function(e){var t;if(\\"Z\\"===e)return 0;let r=e.match(m);if(!r)return 0;let a=\\"+\\"===r[1]?-1:1,n=parseInt(r[2]),l=r[3]&&parseInt(r[3])||0;return(t=l)>=0&&t<=59?a*(n*o.s0+l*o.Cg):NaN}(k.timezone)))return h()}else{let e=new Date(w+x),r=(0,n.a)(0,t?.in);return r.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),r}return(0,n.a)(w+x+l,t?.in)}let s=/[T ]/,i=/[Z ]/i,d=/([Z+-].*)$/,c=/^-?(?:(\\\\d{3})|(\\\\d{2})(?:-?(\\\\d{2}))?|W(\\\\d{2})(?:-?(\\\\d{1}))?|)$/,u=/^(\\\\d{2}(?:[.,]\\\\d*)?)(?::?(\\\\d{2}(?:[.,]\\\\d*)?))?(?::?(\\\\d{2}(?:[.,]\\\\d*)?))?$/,m=/^([+-])(\\\\d{2})(?::?(\\\\d{2}))?$/;function p(e){return e?parseInt(e):1}function f(e){return e&&parseFloat(e.replace(\\",\\",\\".\\"))||0}let g=[31,null,31,30,31,30,31,31,30,31,30,31];function b(e){return e%400==0||e%4==0&&e%100!=0}},5266:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"check\\",[[\\"path\\",{d:\\"M20 6 9 17l-5-5\\",key:\\"1gmf2c\\"}]])},5449:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"lock\\",[[\\"rect\\",{width:\\"18\\",height:\\"11\\",x:\\"3\\",y:\\"11\\",rx:\\"2\\",ry:\\"2\\",key:\\"1w4ew1\\"}],[\\"path\\",{d:\\"M7 11V7a5 5 0 0 1 10 0v4\\",key:\\"fwvmzm\\"}]])},6259:(e,t,r)=>{\\"use strict\\";r.d(t,{Y:()=>a});var o=r(8333);function a(e,t){return+(0,o.a)(e)<+(0,o.a)(t)}},6264:(e,t,r)=>{\\"use strict\\";r.d(t,{QP:()=>ei});let o=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),a=[],n=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let o=e[t],a=r.nextPart.get(o);if(a){let r=n(e,t+1,a);if(r)return r}let l=r.validators;if(null===l)return;let s=0===t?e.join(\\"-\\"):e.slice(t).join(\\"-\\"),i=l.length;for(let e=0;e{let r=o();for(let o in e)s(e[o],r,o,t);return r},s=(e,t,r,o)=>{let a=e.length;for(let n=0;n{\\"string\\"==typeof e?d(e,t,r):\\"function\\"==typeof e?c(e,t,r,o):u(e,t,r,o)},d=(e,t,r)=>{(\\"\\"===e?t:m(t,e)).classGroupId=r},c=(e,t,r,o)=>{p(e)?s(e(o),t,r,o):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},u=(e,t,r,o)=>{let a=Object.entries(e),n=a.length;for(let e=0;e{let r=e,a=t.split(\\"-\\"),n=a.length;for(let e=0;e\\"isThemeGetter\\"in e&&!0===e.isThemeGetter,f=[],g=(e,t,r,o,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:a}),b=/\\\\s+/,h=e=>{let t;if(\\"string\\"==typeof e)return e;let r=\\"\\";for(let o=0;o{let t=t=>t[e]||y;return t.isThemeGetter=!0,t},w=/^\\\\[(?:(\\\\w[\\\\w-]*):)?(.+)\\\\]$/i,x=/^\\\\((?:(\\\\w[\\\\w-]*):)?(.+)\\\\)$/i,v=/^\\\\d+\\\\/\\\\d+$/,z=/^(\\\\d+(\\\\.\\\\d+)?)?(xs|sm|md|lg|xl)$/,M=/\\\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\\\b(calc|min|max|clamp)\\\\(.+\\\\)|^0$/,N=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\\\\(.+\\\\)$/,j=/^(inset_)?-?((\\\\d+)?\\\\.?(\\\\d+)[a-z]+|0)_-?((\\\\d+)?\\\\.?(\\\\d+)[a-z]+|0)/,C=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\\\(.+\\\\)$/,A=e=>v.test(e),_=e=>!!e&&!Number.isNaN(Number(e)),D=e=>!!e&&Number.isInteger(Number(e)),O=e=>e.endsWith(\\"%\\")&&_(e.slice(0,-1)),S=e=>z.test(e),T=()=>!0,U=e=>M.test(e)&&!N.test(e),I=()=>!1,$=e=>j.test(e),H=e=>C.test(e),P=e=>!F(e)&&!L(e),G=e=>X(e,eo,I),F=e=>w.test(e),Y=e=>X(e,ea,U),q=e=>X(e,en,_),E=e=>X(e,et,I),W=e=>X(e,er,H),V=e=>X(e,es,$),L=e=>x.test(e),Z=e=>ee(e,ea),B=e=>ee(e,el),Q=e=>ee(e,et),R=e=>ee(e,eo),J=e=>ee(e,er),K=e=>ee(e,es,!0),X=(e,t,r)=>{let o=w.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},ee=(e,t,r=!1)=>{let o=x.exec(e);return!!o&&(o[1]?t(o[1]):r)},et=e=>\\"position\\"===e||\\"percentage\\"===e,er=e=>\\"image\\"===e||\\"url\\"===e,eo=e=>\\"length\\"===e||\\"size\\"===e||\\"bg-size\\"===e,ea=e=>\\"length\\"===e,en=e=>\\"number\\"===e,el=e=>\\"family-name\\"===e,es=e=>\\"shadow\\"===e,ei=((e,...t)=>{let r,o,s,i,d=e=>{let t=o(e);if(t)return t;let a=((e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:n}=t,l=[],s=e.trim().split(b),i=\\"\\";for(let e=s.length-1;e>=0;e-=1){let t=s[e],{isExternal:d,modifiers:c,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:p}=r(t);if(d){i=t+(i.length>0?\\" \\"+i:i);continue}let f=!!p,g=o(f?m.substring(0,p):m);if(!g){if(!f||!(g=o(m))){i=t+(i.length>0?\\" \\"+i:i);continue}f=!1}let b=0===c.length?\\"\\":1===c.length?c[0]:n(c).join(\\":\\"),h=u?b+\\"!\\":b,y=h+g;if(l.indexOf(y)>-1)continue;l.push(y);let k=a(g,f);for(let e=0;e0?\\" \\"+i:i)}return i})(e,r);return s(e,a),a};return i=c=>{var u;let m;return o=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null),a=(a,n)=>{r[a]=n,++t>e&&(t=0,o=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=o[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}})((u=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,o=e=>{let t,r=[],o=0,a=0,n=0,l=e.length;for(let s=0;sn?t-n:void 0)};if(t){let e=t+\\":\\",r=o;o=t=>t.startsWith(e)?r(t.slice(e.length)):g(f,!1,t,void 0,!0)}if(r){let e=o;o=t=>r({className:t,parseClassName:e})}return o})(u),sortModifiers:(m=new Map,u.orderSensitiveModifiers.forEach((e,t)=>{m.set(e,1e6+t)}),e=>{let t=[],r=[];for(let o=0;o0&&(r.sort(),t.push(...r),r=[]),t.push(a)):r.push(a)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return l(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{if(e.startsWith(\\"[\\")&&e.endsWith(\\"]\\")){var r;let t,o,a;return -1===(r=e).slice(1,-1).indexOf(\\":\\")?void 0:(o=(t=r.slice(1,-1)).indexOf(\\":\\"),(a=t.slice(0,o))?\\"arbitrary..\\"+a:void 0)}let o=e.split(\\"-\\"),a=+(\\"\\"===o[0]&&o.length>1);return n(o,a,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=o[e],n=r[e];if(t){if(n){let e=Array(n.length+t.length);for(let t=0;ti(((...e)=>{let t,r,o=0,a=\\"\\";for(;o{let e=k(\\"color\\"),t=k(\\"font\\"),r=k(\\"text\\"),o=k(\\"font-weight\\"),a=k(\\"tracking\\"),n=k(\\"leading\\"),l=k(\\"breakpoint\\"),s=k(\\"container\\"),i=k(\\"spacing\\"),d=k(\\"radius\\"),c=k(\\"shadow\\"),u=k(\\"inset-shadow\\"),m=k(\\"text-shadow\\"),p=k(\\"drop-shadow\\"),f=k(\\"blur\\"),g=k(\\"perspective\\"),b=k(\\"aspect\\"),h=k(\\"ease\\"),y=k(\\"animate\\"),w=()=>[\\"auto\\",\\"avoid\\",\\"all\\",\\"avoid-page\\",\\"page\\",\\"left\\",\\"right\\",\\"column\\"],x=()=>[\\"center\\",\\"top\\",\\"bottom\\",\\"left\\",\\"right\\",\\"top-left\\",\\"left-top\\",\\"top-right\\",\\"right-top\\",\\"bottom-right\\",\\"right-bottom\\",\\"bottom-left\\",\\"left-bottom\\"],v=()=>[...x(),L,F],z=()=>[\\"auto\\",\\"hidden\\",\\"clip\\",\\"visible\\",\\"scroll\\"],M=()=>[\\"auto\\",\\"contain\\",\\"none\\"],N=()=>[L,F,i],j=()=>[A,\\"full\\",\\"auto\\",...N()],C=()=>[D,\\"none\\",\\"subgrid\\",L,F],U=()=>[\\"auto\\",{span:[\\"full\\",D,L,F]},D,L,F],I=()=>[D,\\"auto\\",L,F],$=()=>[\\"auto\\",\\"min\\",\\"max\\",\\"fr\\",L,F],H=()=>[\\"start\\",\\"end\\",\\"center\\",\\"between\\",\\"around\\",\\"evenly\\",\\"stretch\\",\\"baseline\\",\\"center-safe\\",\\"end-safe\\"],X=()=>[\\"start\\",\\"end\\",\\"center\\",\\"stretch\\",\\"center-safe\\",\\"end-safe\\"],ee=()=>[\\"auto\\",...N()],et=()=>[A,\\"auto\\",\\"full\\",\\"dvw\\",\\"dvh\\",\\"lvw\\",\\"lvh\\",\\"svw\\",\\"svh\\",\\"min\\",\\"max\\",\\"fit\\",...N()],er=()=>[e,L,F],eo=()=>[...x(),Q,E,{position:[L,F]}],ea=()=>[\\"no-repeat\\",{repeat:[\\"\\",\\"x\\",\\"y\\",\\"space\\",\\"round\\"]}],en=()=>[\\"auto\\",\\"cover\\",\\"contain\\",R,G,{size:[L,F]}],el=()=>[O,Z,Y],es=()=>[\\"\\",\\"none\\",\\"full\\",d,L,F],ei=()=>[\\"\\",_,Z,Y],ed=()=>[\\"solid\\",\\"dashed\\",\\"dotted\\",\\"double\\"],ec=()=>[\\"normal\\",\\"multiply\\",\\"screen\\",\\"overlay\\",\\"darken\\",\\"lighten\\",\\"color-dodge\\",\\"color-burn\\",\\"hard-light\\",\\"soft-light\\",\\"difference\\",\\"exclusion\\",\\"hue\\",\\"saturation\\",\\"color\\",\\"luminosity\\"],eu=()=>[_,O,Q,E],em=()=>[\\"\\",\\"none\\",f,L,F],ep=()=>[\\"none\\",_,L,F],ef=()=>[\\"none\\",_,L,F],eg=()=>[_,L,F],eb=()=>[A,\\"full\\",...N()];return{cacheSize:500,theme:{animate:[\\"spin\\",\\"ping\\",\\"pulse\\",\\"bounce\\"],aspect:[\\"video\\"],blur:[S],breakpoint:[S],color:[T],container:[S],\\"drop-shadow\\":[S],ease:[\\"in\\",\\"out\\",\\"in-out\\"],font:[P],\\"font-weight\\":[\\"thin\\",\\"extralight\\",\\"light\\",\\"normal\\",\\"medium\\",\\"semibold\\",\\"bold\\",\\"extrabold\\",\\"black\\"],\\"inset-shadow\\":[S],leading:[\\"none\\",\\"tight\\",\\"snug\\",\\"normal\\",\\"relaxed\\",\\"loose\\"],perspective:[\\"dramatic\\",\\"near\\",\\"normal\\",\\"midrange\\",\\"distant\\",\\"none\\"],radius:[S],shadow:[S],spacing:[\\"px\\",_],text:[S],\\"text-shadow\\":[S],tracking:[\\"tighter\\",\\"tight\\",\\"normal\\",\\"wide\\",\\"wider\\",\\"widest\\"]},classGroups:{aspect:[{aspect:[\\"auto\\",\\"square\\",A,F,L,b]}],container:[\\"container\\"],columns:[{columns:[_,F,L,s]}],\\"break-after\\":[{\\"break-after\\":w()}],\\"break-before\\":[{\\"break-before\\":w()}],\\"break-inside\\":[{\\"break-inside\\":[\\"auto\\",\\"avoid\\",\\"avoid-page\\",\\"avoid-column\\"]}],\\"box-decoration\\":[{\\"box-decoration\\":[\\"slice\\",\\"clone\\"]}],box:[{box:[\\"border\\",\\"content\\"]}],display:[\\"block\\",\\"inline-block\\",\\"inline\\",\\"flex\\",\\"inline-flex\\",\\"table\\",\\"inline-table\\",\\"table-caption\\",\\"table-cell\\",\\"table-column\\",\\"table-column-group\\",\\"table-footer-group\\",\\"table-header-group\\",\\"table-row-group\\",\\"table-row\\",\\"flow-root\\",\\"grid\\",\\"inline-grid\\",\\"contents\\",\\"list-item\\",\\"hidden\\"],sr:[\\"sr-only\\",\\"not-sr-only\\"],float:[{float:[\\"right\\",\\"left\\",\\"none\\",\\"start\\",\\"end\\"]}],clear:[{clear:[\\"left\\",\\"right\\",\\"both\\",\\"none\\",\\"start\\",\\"end\\"]}],isolation:[\\"isolate\\",\\"isolation-auto\\"],\\"object-fit\\":[{object:[\\"contain\\",\\"cover\\",\\"fill\\",\\"none\\",\\"scale-down\\"]}],\\"object-position\\":[{object:v()}],overflow:[{overflow:z()}],\\"overflow-x\\":[{\\"overflow-x\\":z()}],\\"overflow-y\\":[{\\"overflow-y\\":z()}],overscroll:[{overscroll:M()}],\\"overscroll-x\\":[{\\"overscroll-x\\":M()}],\\"overscroll-y\\":[{\\"overscroll-y\\":M()}],position:[\\"static\\",\\"fixed\\",\\"absolute\\",\\"relative\\",\\"sticky\\"],inset:[{inset:j()}],\\"inset-x\\":[{\\"inset-x\\":j()}],\\"inset-y\\":[{\\"inset-y\\":j()}],start:[{start:j()}],end:[{end:j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:[\\"visible\\",\\"invisible\\",\\"collapse\\"],z:[{z:[D,\\"auto\\",L,F]}],basis:[{basis:[A,\\"full\\",\\"auto\\",s,...N()]}],\\"flex-direction\\":[{flex:[\\"row\\",\\"row-reverse\\",\\"col\\",\\"col-reverse\\"]}],\\"flex-wrap\\":[{flex:[\\"nowrap\\",\\"wrap\\",\\"wrap-reverse\\"]}],flex:[{flex:[_,A,\\"auto\\",\\"initial\\",\\"none\\",F]}],grow:[{grow:[\\"\\",_,L,F]}],shrink:[{shrink:[\\"\\",_,L,F]}],order:[{order:[D,\\"first\\",\\"last\\",\\"none\\",L,F]}],\\"grid-cols\\":[{\\"grid-cols\\":C()}],\\"col-start-end\\":[{col:U()}],\\"col-start\\":[{\\"col-start\\":I()}],\\"col-end\\":[{\\"col-end\\":I()}],\\"grid-rows\\":[{\\"grid-rows\\":C()}],\\"row-start-end\\":[{row:U()}],\\"row-start\\":[{\\"row-start\\":I()}],\\"row-end\\":[{\\"row-end\\":I()}],\\"grid-flow\\":[{\\"grid-flow\\":[\\"row\\",\\"col\\",\\"dense\\",\\"row-dense\\",\\"col-dense\\"]}],\\"auto-cols\\":[{\\"auto-cols\\":$()}],\\"auto-rows\\":[{\\"auto-rows\\":$()}],gap:[{gap:N()}],\\"gap-x\\":[{\\"gap-x\\":N()}],\\"gap-y\\":[{\\"gap-y\\":N()}],\\"justify-content\\":[{justify:[...H(),\\"normal\\"]}],\\"justify-items\\":[{\\"justify-items\\":[...X(),\\"normal\\"]}],\\"justify-self\\":[{\\"justify-self\\":[\\"auto\\",...X()]}],\\"align-content\\":[{content:[\\"normal\\",...H()]}],\\"align-items\\":[{items:[...X(),{baseline:[\\"\\",\\"last\\"]}]}],\\"align-self\\":[{self:[\\"auto\\",...X(),{baseline:[\\"\\",\\"last\\"]}]}],\\"place-content\\":[{\\"place-content\\":H()}],\\"place-items\\":[{\\"place-items\\":[...X(),\\"baseline\\"]}],\\"place-self\\":[{\\"place-self\\":[\\"auto\\",...X()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],\\"space-x\\":[{\\"space-x\\":N()}],\\"space-x-reverse\\":[\\"space-x-reverse\\"],\\"space-y\\":[{\\"space-y\\":N()}],\\"space-y-reverse\\":[\\"space-y-reverse\\"],size:[{size:et()}],w:[{w:[s,\\"screen\\",...et()]}],\\"min-w\\":[{\\"min-w\\":[s,\\"screen\\",\\"none\\",...et()]}],\\"max-w\\":[{\\"max-w\\":[s,\\"screen\\",\\"none\\",\\"prose\\",{screen:[l]},...et()]}],h:[{h:[\\"screen\\",\\"lh\\",...et()]}],\\"min-h\\":[{\\"min-h\\":[\\"screen\\",\\"lh\\",\\"none\\",...et()]}],\\"max-h\\":[{\\"max-h\\":[\\"screen\\",\\"lh\\",...et()]}],\\"font-size\\":[{text:[\\"base\\",r,Z,Y]}],\\"font-smoothing\\":[\\"antialiased\\",\\"subpixel-antialiased\\"],\\"font-style\\":[\\"italic\\",\\"not-italic\\"],\\"font-weight\\":[{font:[o,L,q]}],\\"font-stretch\\":[{\\"font-stretch\\":[\\"ultra-condensed\\",\\"extra-condensed\\",\\"condensed\\",\\"semi-condensed\\",\\"normal\\",\\"semi-expanded\\",\\"expanded\\",\\"extra-expanded\\",\\"ultra-expanded\\",O,F]}],\\"font-family\\":[{font:[B,F,t]}],\\"fvn-normal\\":[\\"normal-nums\\"],\\"fvn-ordinal\\":[\\"ordinal\\"],\\"fvn-slashed-zero\\":[\\"slashed-zero\\"],\\"fvn-figure\\":[\\"lining-nums\\",\\"oldstyle-nums\\"],\\"fvn-spacing\\":[\\"proportional-nums\\",\\"tabular-nums\\"],\\"fvn-fraction\\":[\\"diagonal-fractions\\",\\"stacked-fractions\\"],tracking:[{tracking:[a,L,F]}],\\"line-clamp\\":[{\\"line-clamp\\":[_,\\"none\\",L,q]}],leading:[{leading:[n,...N()]}],\\"list-image\\":[{\\"list-image\\":[\\"none\\",L,F]}],\\"list-style-position\\":[{list:[\\"inside\\",\\"outside\\"]}],\\"list-style-type\\":[{list:[\\"disc\\",\\"decimal\\",\\"none\\",L,F]}],\\"text-alignment\\":[{text:[\\"left\\",\\"center\\",\\"right\\",\\"justify\\",\\"start\\",\\"end\\"]}],\\"placeholder-color\\":[{placeholder:er()}],\\"text-color\\":[{text:er()}],\\"text-decoration\\":[\\"underline\\",\\"overline\\",\\"line-through\\",\\"no-underline\\"],\\"text-decoration-style\\":[{decoration:[...ed(),\\"wavy\\"]}],\\"text-decoration-thickness\\":[{decoration:[_,\\"from-font\\",\\"auto\\",L,Y]}],\\"text-decoration-color\\":[{decoration:er()}],\\"underline-offset\\":[{\\"underline-offset\\":[_,\\"auto\\",L,F]}],\\"text-transform\\":[\\"uppercase\\",\\"lowercase\\",\\"capitalize\\",\\"normal-case\\"],\\"text-overflow\\":[\\"truncate\\",\\"text-ellipsis\\",\\"text-clip\\"],\\"text-wrap\\":[{text:[\\"wrap\\",\\"nowrap\\",\\"balance\\",\\"pretty\\"]}],indent:[{indent:N()}],\\"vertical-align\\":[{align:[\\"baseline\\",\\"top\\",\\"middle\\",\\"bottom\\",\\"text-top\\",\\"text-bottom\\",\\"sub\\",\\"super\\",L,F]}],whitespace:[{whitespace:[\\"normal\\",\\"nowrap\\",\\"pre\\",\\"pre-line\\",\\"pre-wrap\\",\\"break-spaces\\"]}],break:[{break:[\\"normal\\",\\"words\\",\\"all\\",\\"keep\\"]}],wrap:[{wrap:[\\"break-word\\",\\"anywhere\\",\\"normal\\"]}],hyphens:[{hyphens:[\\"none\\",\\"manual\\",\\"auto\\"]}],content:[{content:[\\"none\\",L,F]}],\\"bg-attachment\\":[{bg:[\\"fixed\\",\\"local\\",\\"scroll\\"]}],\\"bg-clip\\":[{\\"bg-clip\\":[\\"border\\",\\"padding\\",\\"content\\",\\"text\\"]}],\\"bg-origin\\":[{\\"bg-origin\\":[\\"border\\",\\"padding\\",\\"content\\"]}],\\"bg-position\\":[{bg:eo()}],\\"bg-repeat\\":[{bg:ea()}],\\"bg-size\\":[{bg:en()}],\\"bg-image\\":[{bg:[\\"none\\",{linear:[{to:[\\"t\\",\\"tr\\",\\"r\\",\\"br\\",\\"b\\",\\"bl\\",\\"l\\",\\"tl\\"]},D,L,F],radial:[\\"\\",L,F],conic:[D,L,F]},J,W]}],\\"bg-color\\":[{bg:er()}],\\"gradient-from-pos\\":[{from:el()}],\\"gradient-via-pos\\":[{via:el()}],\\"gradient-to-pos\\":[{to:el()}],\\"gradient-from\\":[{from:er()}],\\"gradient-via\\":[{via:er()}],\\"gradient-to\\":[{to:er()}],rounded:[{rounded:es()}],\\"rounded-s\\":[{\\"rounded-s\\":es()}],\\"rounded-e\\":[{\\"rounded-e\\":es()}],\\"rounded-t\\":[{\\"rounded-t\\":es()}],\\"rounded-r\\":[{\\"rounded-r\\":es()}],\\"rounded-b\\":[{\\"rounded-b\\":es()}],\\"rounded-l\\":[{\\"rounded-l\\":es()}],\\"rounded-ss\\":[{\\"rounded-ss\\":es()}],\\"rounded-se\\":[{\\"rounded-se\\":es()}],\\"rounded-ee\\":[{\\"rounded-ee\\":es()}],\\"rounded-es\\":[{\\"rounded-es\\":es()}],\\"rounded-tl\\":[{\\"rounded-tl\\":es()}],\\"rounded-tr\\":[{\\"rounded-tr\\":es()}],\\"rounded-br\\":[{\\"rounded-br\\":es()}],\\"rounded-bl\\":[{\\"rounded-bl\\":es()}],\\"border-w\\":[{border:ei()}],\\"border-w-x\\":[{\\"border-x\\":ei()}],\\"border-w-y\\":[{\\"border-y\\":ei()}],\\"border-w-s\\":[{\\"border-s\\":ei()}],\\"border-w-e\\":[{\\"border-e\\":ei()}],\\"border-w-t\\":[{\\"border-t\\":ei()}],\\"border-w-r\\":[{\\"border-r\\":ei()}],\\"border-w-b\\":[{\\"border-b\\":ei()}],\\"border-w-l\\":[{\\"border-l\\":ei()}],\\"divide-x\\":[{\\"divide-x\\":ei()}],\\"divide-x-reverse\\":[\\"divide-x-reverse\\"],\\"divide-y\\":[{\\"divide-y\\":ei()}],\\"divide-y-reverse\\":[\\"divide-y-reverse\\"],\\"border-style\\":[{border:[...ed(),\\"hidden\\",\\"none\\"]}],\\"divide-style\\":[{divide:[...ed(),\\"hidden\\",\\"none\\"]}],\\"border-color\\":[{border:er()}],\\"border-color-x\\":[{\\"border-x\\":er()}],\\"border-color-y\\":[{\\"border-y\\":er()}],\\"border-color-s\\":[{\\"border-s\\":er()}],\\"border-color-e\\":[{\\"border-e\\":er()}],\\"border-color-t\\":[{\\"border-t\\":er()}],\\"border-color-r\\":[{\\"border-r\\":er()}],\\"border-color-b\\":[{\\"border-b\\":er()}],\\"border-color-l\\":[{\\"border-l\\":er()}],\\"divide-color\\":[{divide:er()}],\\"outline-style\\":[{outline:[...ed(),\\"none\\",\\"hidden\\"]}],\\"outline-offset\\":[{\\"outline-offset\\":[_,L,F]}],\\"outline-w\\":[{outline:[\\"\\",_,Z,Y]}],\\"outline-color\\":[{outline:er()}],shadow:[{shadow:[\\"\\",\\"none\\",c,K,V]}],\\"shadow-color\\":[{shadow:er()}],\\"inset-shadow\\":[{\\"inset-shadow\\":[\\"none\\",u,K,V]}],\\"inset-shadow-color\\":[{\\"inset-shadow\\":er()}],\\"ring-w\\":[{ring:ei()}],\\"ring-w-inset\\":[\\"ring-inset\\"],\\"ring-color\\":[{ring:er()}],\\"ring-offset-w\\":[{\\"ring-offset\\":[_,Y]}],\\"ring-offset-color\\":[{\\"ring-offset\\":er()}],\\"inset-ring-w\\":[{\\"inset-ring\\":ei()}],\\"inset-ring-color\\":[{\\"inset-ring\\":er()}],\\"text-shadow\\":[{\\"text-shadow\\":[\\"none\\",m,K,V]}],\\"text-shadow-color\\":[{\\"text-shadow\\":er()}],opacity:[{opacity:[_,L,F]}],\\"mix-blend\\":[{\\"mix-blend\\":[...ec(),\\"plus-darker\\",\\"plus-lighter\\"]}],\\"bg-blend\\":[{\\"bg-blend\\":ec()}],\\"mask-clip\\":[{\\"mask-clip\\":[\\"border\\",\\"padding\\",\\"content\\",\\"fill\\",\\"stroke\\",\\"view\\"]},\\"mask-no-clip\\"],\\"mask-composite\\":[{mask:[\\"add\\",\\"subtract\\",\\"intersect\\",\\"exclude\\"]}],\\"mask-image-linear-pos\\":[{\\"mask-linear\\":[_]}],\\"mask-image-linear-from-pos\\":[{\\"mask-linear-from\\":eu()}],\\"mask-image-linear-to-pos\\":[{\\"mask-linear-to\\":eu()}],\\"mask-image-linear-from-color\\":[{\\"mask-linear-from\\":er()}],\\"mask-image-linear-to-color\\":[{\\"mask-linear-to\\":er()}],\\"mask-image-t-from-pos\\":[{\\"mask-t-from\\":eu()}],\\"mask-image-t-to-pos\\":[{\\"mask-t-to\\":eu()}],\\"mask-image-t-from-color\\":[{\\"mask-t-from\\":er()}],\\"mask-image-t-to-color\\":[{\\"mask-t-to\\":er()}],\\"mask-image-r-from-pos\\":[{\\"mask-r-from\\":eu()}],\\"mask-image-r-to-pos\\":[{\\"mask-r-to\\":eu()}],\\"mask-image-r-from-color\\":[{\\"mask-r-from\\":er()}],\\"mask-image-r-to-color\\":[{\\"mask-r-to\\":er()}],\\"mask-image-b-from-pos\\":[{\\"mask-b-from\\":eu()}],\\"mask-image-b-to-pos\\":[{\\"mask-b-to\\":eu()}],\\"mask-image-b-from-color\\":[{\\"mask-b-from\\":er()}],\\"mask-image-b-to-color\\":[{\\"mask-b-to\\":er()}],\\"mask-image-l-from-pos\\":[{\\"mask-l-from\\":eu()}],\\"mask-image-l-to-pos\\":[{\\"mask-l-to\\":eu()}],\\"mask-image-l-from-color\\":[{\\"mask-l-from\\":er()}],\\"mask-image-l-to-color\\":[{\\"mask-l-to\\":er()}],\\"mask-image-x-from-pos\\":[{\\"mask-x-from\\":eu()}],\\"mask-image-x-to-pos\\":[{\\"mask-x-to\\":eu()}],\\"mask-image-x-from-color\\":[{\\"mask-x-from\\":er()}],\\"mask-image-x-to-color\\":[{\\"mask-x-to\\":er()}],\\"mask-image-y-from-pos\\":[{\\"mask-y-from\\":eu()}],\\"mask-image-y-to-pos\\":[{\\"mask-y-to\\":eu()}],\\"mask-image-y-from-color\\":[{\\"mask-y-from\\":er()}],\\"mask-image-y-to-color\\":[{\\"mask-y-to\\":er()}],\\"mask-image-radial\\":[{\\"mask-radial\\":[L,F]}],\\"mask-image-radial-from-pos\\":[{\\"mask-radial-from\\":eu()}],\\"mask-image-radial-to-pos\\":[{\\"mask-radial-to\\":eu()}],\\"mask-image-radial-from-color\\":[{\\"mask-radial-from\\":er()}],\\"mask-image-radial-to-color\\":[{\\"mask-radial-to\\":er()}],\\"mask-image-radial-shape\\":[{\\"mask-radial\\":[\\"circle\\",\\"ellipse\\"]}],\\"mask-image-radial-size\\":[{\\"mask-radial\\":[{closest:[\\"side\\",\\"corner\\"],farthest:[\\"side\\",\\"corner\\"]}]}],\\"mask-image-radial-pos\\":[{\\"mask-radial-at\\":x()}],\\"mask-image-conic-pos\\":[{\\"mask-conic\\":[_]}],\\"mask-image-conic-from-pos\\":[{\\"mask-conic-from\\":eu()}],\\"mask-image-conic-to-pos\\":[{\\"mask-conic-to\\":eu()}],\\"mask-image-conic-from-color\\":[{\\"mask-conic-from\\":er()}],\\"mask-image-conic-to-color\\":[{\\"mask-conic-to\\":er()}],\\"mask-mode\\":[{mask:[\\"alpha\\",\\"luminance\\",\\"match\\"]}],\\"mask-origin\\":[{\\"mask-origin\\":[\\"border\\",\\"padding\\",\\"content\\",\\"fill\\",\\"stroke\\",\\"view\\"]}],\\"mask-position\\":[{mask:eo()}],\\"mask-repeat\\":[{mask:ea()}],\\"mask-size\\":[{mask:en()}],\\"mask-type\\":[{\\"mask-type\\":[\\"alpha\\",\\"luminance\\"]}],\\"mask-image\\":[{mask:[\\"none\\",L,F]}],filter:[{filter:[\\"\\",\\"none\\",L,F]}],blur:[{blur:em()}],brightness:[{brightness:[_,L,F]}],contrast:[{contrast:[_,L,F]}],\\"drop-shadow\\":[{\\"drop-shadow\\":[\\"\\",\\"none\\",p,K,V]}],\\"drop-shadow-color\\":[{\\"drop-shadow\\":er()}],grayscale:[{grayscale:[\\"\\",_,L,F]}],\\"hue-rotate\\":[{\\"hue-rotate\\":[_,L,F]}],invert:[{invert:[\\"\\",_,L,F]}],saturate:[{saturate:[_,L,F]}],sepia:[{sepia:[\\"\\",_,L,F]}],\\"backdrop-filter\\":[{\\"backdrop-filter\\":[\\"\\",\\"none\\",L,F]}],\\"backdrop-blur\\":[{\\"backdrop-blur\\":em()}],\\"backdrop-brightness\\":[{\\"backdrop-brightness\\":[_,L,F]}],\\"backdrop-contrast\\":[{\\"backdrop-contrast\\":[_,L,F]}],\\"backdrop-grayscale\\":[{\\"backdrop-grayscale\\":[\\"\\",_,L,F]}],\\"backdrop-hue-rotate\\":[{\\"backdrop-hue-rotate\\":[_,L,F]}],\\"backdrop-invert\\":[{\\"backdrop-invert\\":[\\"\\",_,L,F]}],\\"backdrop-opacity\\":[{\\"backdrop-opacity\\":[_,L,F]}],\\"backdrop-saturate\\":[{\\"backdrop-saturate\\":[_,L,F]}],\\"backdrop-sepia\\":[{\\"backdrop-sepia\\":[\\"\\",_,L,F]}],\\"border-collapse\\":[{border:[\\"collapse\\",\\"separate\\"]}],\\"border-spacing\\":[{\\"border-spacing\\":N()}],\\"border-spacing-x\\":[{\\"border-spacing-x\\":N()}],\\"border-spacing-y\\":[{\\"border-spacing-y\\":N()}],\\"table-layout\\":[{table:[\\"auto\\",\\"fixed\\"]}],caption:[{caption:[\\"top\\",\\"bottom\\"]}],transition:[{transition:[\\"\\",\\"all\\",\\"colors\\",\\"opacity\\",\\"shadow\\",\\"transform\\",\\"none\\",L,F]}],\\"transition-behavior\\":[{transition:[\\"normal\\",\\"discrete\\"]}],duration:[{duration:[_,\\"initial\\",L,F]}],ease:[{ease:[\\"linear\\",\\"initial\\",h,L,F]}],delay:[{delay:[_,L,F]}],animate:[{animate:[\\"none\\",y,L,F]}],backface:[{backface:[\\"hidden\\",\\"visible\\"]}],perspective:[{perspective:[g,L,F]}],\\"perspective-origin\\":[{\\"perspective-origin\\":v()}],rotate:[{rotate:ep()}],\\"rotate-x\\":[{\\"rotate-x\\":ep()}],\\"rotate-y\\":[{\\"rotate-y\\":ep()}],\\"rotate-z\\":[{\\"rotate-z\\":ep()}],scale:[{scale:ef()}],\\"scale-x\\":[{\\"scale-x\\":ef()}],\\"scale-y\\":[{\\"scale-y\\":ef()}],\\"scale-z\\":[{\\"scale-z\\":ef()}],\\"scale-3d\\":[\\"scale-3d\\"],skew:[{skew:eg()}],\\"skew-x\\":[{\\"skew-x\\":eg()}],\\"skew-y\\":[{\\"skew-y\\":eg()}],transform:[{transform:[L,F,\\"\\",\\"none\\",\\"gpu\\",\\"cpu\\"]}],\\"transform-origin\\":[{origin:v()}],\\"transform-style\\":[{transform:[\\"3d\\",\\"flat\\"]}],translate:[{translate:eb()}],\\"translate-x\\":[{\\"translate-x\\":eb()}],\\"translate-y\\":[{\\"translate-y\\":eb()}],\\"translate-z\\":[{\\"translate-z\\":eb()}],\\"translate-none\\":[\\"translate-none\\"],accent:[{accent:er()}],appearance:[{appearance:[\\"none\\",\\"auto\\"]}],\\"caret-color\\":[{caret:er()}],\\"color-scheme\\":[{scheme:[\\"normal\\",\\"dark\\",\\"light\\",\\"light-dark\\",\\"only-dark\\",\\"only-light\\"]}],cursor:[{cursor:[\\"auto\\",\\"default\\",\\"pointer\\",\\"wait\\",\\"text\\",\\"move\\",\\"help\\",\\"not-allowed\\",\\"none\\",\\"context-menu\\",\\"progress\\",\\"cell\\",\\"crosshair\\",\\"vertical-text\\",\\"alias\\",\\"copy\\",\\"no-drop\\",\\"grab\\",\\"grabbing\\",\\"all-scroll\\",\\"col-resize\\",\\"row-resize\\",\\"n-resize\\",\\"e-resize\\",\\"s-resize\\",\\"w-resize\\",\\"ne-resize\\",\\"nw-resize\\",\\"se-resize\\",\\"sw-resize\\",\\"ew-resize\\",\\"ns-resize\\",\\"nesw-resize\\",\\"nwse-resize\\",\\"zoom-in\\",\\"zoom-out\\",L,F]}],\\"field-sizing\\":[{\\"field-sizing\\":[\\"fixed\\",\\"content\\"]}],\\"pointer-events\\":[{\\"pointer-events\\":[\\"auto\\",\\"none\\"]}],resize:[{resize:[\\"none\\",\\"\\",\\"y\\",\\"x\\"]}],\\"scroll-behavior\\":[{scroll:[\\"auto\\",\\"smooth\\"]}],\\"scroll-m\\":[{\\"scroll-m\\":N()}],\\"scroll-mx\\":[{\\"scroll-mx\\":N()}],\\"scroll-my\\":[{\\"scroll-my\\":N()}],\\"scroll-ms\\":[{\\"scroll-ms\\":N()}],\\"scroll-me\\":[{\\"scroll-me\\":N()}],\\"scroll-mt\\":[{\\"scroll-mt\\":N()}],\\"scroll-mr\\":[{\\"scroll-mr\\":N()}],\\"scroll-mb\\":[{\\"scroll-mb\\":N()}],\\"scroll-ml\\":[{\\"scroll-ml\\":N()}],\\"scroll-p\\":[{\\"scroll-p\\":N()}],\\"scroll-px\\":[{\\"scroll-px\\":N()}],\\"scroll-py\\":[{\\"scroll-py\\":N()}],\\"scroll-ps\\":[{\\"scroll-ps\\":N()}],\\"scroll-pe\\":[{\\"scroll-pe\\":N()}],\\"scroll-pt\\":[{\\"scroll-pt\\":N()}],\\"scroll-pr\\":[{\\"scroll-pr\\":N()}],\\"scroll-pb\\":[{\\"scroll-pb\\":N()}],\\"scroll-pl\\":[{\\"scroll-pl\\":N()}],\\"snap-align\\":[{snap:[\\"start\\",\\"end\\",\\"center\\",\\"align-none\\"]}],\\"snap-stop\\":[{snap:[\\"normal\\",\\"always\\"]}],\\"snap-type\\":[{snap:[\\"none\\",\\"x\\",\\"y\\",\\"both\\"]}],\\"snap-strictness\\":[{snap:[\\"mandatory\\",\\"proximity\\"]}],touch:[{touch:[\\"auto\\",\\"none\\",\\"manipulation\\"]}],\\"touch-x\\":[{\\"touch-pan\\":[\\"x\\",\\"left\\",\\"right\\"]}],\\"touch-y\\":[{\\"touch-pan\\":[\\"y\\",\\"up\\",\\"down\\"]}],\\"touch-pz\\":[\\"touch-pinch-zoom\\"],select:[{select:[\\"none\\",\\"text\\",\\"all\\",\\"auto\\"]}],\\"will-change\\":[{\\"will-change\\":[\\"auto\\",\\"scroll\\",\\"contents\\",\\"transform\\",L,F]}],fill:[{fill:[\\"none\\",...er()]}],\\"stroke-w\\":[{stroke:[_,Z,Y,q]}],stroke:[{stroke:[\\"none\\",...er()]}],\\"forced-color-adjust\\":[{\\"forced-color-adjust\\":[\\"auto\\",\\"none\\"]}]},conflictingClassGroups:{overflow:[\\"overflow-x\\",\\"overflow-y\\"],overscroll:[\\"overscroll-x\\",\\"overscroll-y\\"],inset:[\\"inset-x\\",\\"inset-y\\",\\"start\\",\\"end\\",\\"top\\",\\"right\\",\\"bottom\\",\\"left\\"],\\"inset-x\\":[\\"right\\",\\"left\\"],\\"inset-y\\":[\\"top\\",\\"bottom\\"],flex:[\\"basis\\",\\"grow\\",\\"shrink\\"],gap:[\\"gap-x\\",\\"gap-y\\"],p:[\\"px\\",\\"py\\",\\"ps\\",\\"pe\\",\\"pt\\",\\"pr\\",\\"pb\\",\\"pl\\"],px:[\\"pr\\",\\"pl\\"],py:[\\"pt\\",\\"pb\\"],m:[\\"mx\\",\\"my\\",\\"ms\\",\\"me\\",\\"mt\\",\\"mr\\",\\"mb\\",\\"ml\\"],mx:[\\"mr\\",\\"ml\\"],my:[\\"mt\\",\\"mb\\"],size:[\\"w\\",\\"h\\"],\\"font-size\\":[\\"leading\\"],\\"fvn-normal\\":[\\"fvn-ordinal\\",\\"fvn-slashed-zero\\",\\"fvn-figure\\",\\"fvn-spacing\\",\\"fvn-fraction\\"],\\"fvn-ordinal\\":[\\"fvn-normal\\"],\\"fvn-slashed-zero\\":[\\"fvn-normal\\"],\\"fvn-figure\\":[\\"fvn-normal\\"],\\"fvn-spacing\\":[\\"fvn-normal\\"],\\"fvn-fraction\\":[\\"fvn-normal\\"],\\"line-clamp\\":[\\"display\\",\\"overflow\\"],rounded:[\\"rounded-s\\",\\"rounded-e\\",\\"rounded-t\\",\\"rounded-r\\",\\"rounded-b\\",\\"rounded-l\\",\\"rounded-ss\\",\\"rounded-se\\",\\"rounded-ee\\",\\"rounded-es\\",\\"rounded-tl\\",\\"rounded-tr\\",\\"rounded-br\\",\\"rounded-bl\\"],\\"rounded-s\\":[\\"rounded-ss\\",\\"rounded-es\\"],\\"rounded-e\\":[\\"rounded-se\\",\\"rounded-ee\\"],\\"rounded-t\\":[\\"rounded-tl\\",\\"rounded-tr\\"],\\"rounded-r\\":[\\"rounded-tr\\",\\"rounded-br\\"],\\"rounded-b\\":[\\"rounded-br\\",\\"rounded-bl\\"],\\"rounded-l\\":[\\"rounded-tl\\",\\"rounded-bl\\"],\\"border-spacing\\":[\\"border-spacing-x\\",\\"border-spacing-y\\"],\\"border-w\\":[\\"border-w-x\\",\\"border-w-y\\",\\"border-w-s\\",\\"border-w-e\\",\\"border-w-t\\",\\"border-w-r\\",\\"border-w-b\\",\\"border-w-l\\"],\\"border-w-x\\":[\\"border-w-r\\",\\"border-w-l\\"],\\"border-w-y\\":[\\"border-w-t\\",\\"border-w-b\\"],\\"border-color\\":[\\"border-color-x\\",\\"border-color-y\\",\\"border-color-s\\",\\"border-color-e\\",\\"border-color-t\\",\\"border-color-r\\",\\"border-color-b\\",\\"border-color-l\\"],\\"border-color-x\\":[\\"border-color-r\\",\\"border-color-l\\"],\\"border-color-y\\":[\\"border-color-t\\",\\"border-color-b\\"],translate:[\\"translate-x\\",\\"translate-y\\",\\"translate-none\\"],\\"translate-none\\":[\\"translate\\",\\"translate-x\\",\\"translate-y\\",\\"translate-z\\"],\\"scroll-m\\":[\\"scroll-mx\\",\\"scroll-my\\",\\"scroll-ms\\",\\"scroll-me\\",\\"scroll-mt\\",\\"scroll-mr\\",\\"scroll-mb\\",\\"scroll-ml\\"],\\"scroll-mx\\":[\\"scroll-mr\\",\\"scroll-ml\\"],\\"scroll-my\\":[\\"scroll-mt\\",\\"scroll-mb\\"],\\"scroll-p\\":[\\"scroll-px\\",\\"scroll-py\\",\\"scroll-ps\\",\\"scroll-pe\\",\\"scroll-pt\\",\\"scroll-pr\\",\\"scroll-pb\\",\\"scroll-pl\\"],\\"scroll-px\\":[\\"scroll-pr\\",\\"scroll-pl\\"],\\"scroll-py\\":[\\"scroll-pt\\",\\"scroll-pb\\"],touch:[\\"touch-x\\",\\"touch-y\\",\\"touch-pz\\"],\\"touch-x\\":[\\"touch\\"],\\"touch-y\\":[\\"touch\\"],\\"touch-pz\\":[\\"touch\\"]},conflictingClassGroupModifiers:{\\"font-size\\":[\\"leading\\"]},orderSensitiveModifiers:[\\"*\\",\\"**\\",\\"after\\",\\"backdrop\\",\\"before\\",\\"details-content\\",\\"file\\",\\"first-letter\\",\\"first-line\\",\\"marker\\",\\"placeholder\\",\\"selection\\"]}})},6346:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"plus\\",[[\\"path\\",{d:\\"M5 12h14\\",key:\\"1ays0h\\"}],[\\"path\\",{d:\\"M12 5v14\\",key:\\"s699le\\"}]])},6747:(e,t,r)=>{\\"use strict\\";r.d(t,{a:()=>a});var o=r(8333);function a(e,t,r){let a=(0,o.a)(e,r?.in);return a.setHours(t),a}},6790:(e,t,r)=>{\\"use strict\\";r.d(t,{p:()=>a});var o=r(8333);function a(e,t){let r=(0,o.a)(e,t?.in),a=r.getMonth();return r.setFullYear(r.getFullYear(),a+1,0),r.setHours(23,59,59,999),r}},6863:(e,t,r)=>{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"eye\\",[[\\"path\\",{d:\\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\\",key:\\"1nclc0\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"3\\",key:\\"1v7zrd\\"}]])},7328:(e,t,r)=>{e.exports=r(8022)},8022:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var o={default:function(){return g},defaultHead:function(){return u}};for(var a in o)Object.defineProperty(t,a,{enumerable:!0,get:o[a]});let n=r(4252),l=r(8365),s=r(7876),i=l._(r(4232)),d=n._(r(8071)),c=r(6972);function u(){return[(0,s.jsx)(\\"meta\\",{charSet:\\"utf-8\\"},\\"charset\\"),(0,s.jsx)(\\"meta\\",{name:\\"viewport\\",content:\\"width=device-width\\"},\\"viewport\\")]}function m(e,t){return\\"string\\"==typeof t||\\"number\\"==typeof t?e:t.type===i.default.Fragment?e.concat(i.default.Children.toArray(t.props.children).reduce((e,t)=>\\"string\\"==typeof t||\\"number\\"==typeof t?e:e.concat(t),[])):e.concat(t)}r(8912);let p=[\\"name\\",\\"httpEquiv\\",\\"charSet\\",\\"itemProp\\"];function f(e){let t,r,o,a;return e.reduce(m,[]).reverse().concat(u().reverse()).filter((t=new Set,r=new Set,o=new Set,a={},e=>{let n=!0,l=!1;if(e.key&&\\"number\\"!=typeof e.key&&e.key.indexOf(\\"$\\")>0){l=!0;let r=e.key.slice(e.key.indexOf(\\"$\\")+1);t.has(r)?n=!1:t.add(r)}switch(e.type){case\\"title\\":case\\"base\\":r.has(e.type)?n=!1:r.add(e.type);break;case\\"meta\\":for(let t=0,r=p.length;t{let r=e.key||t;return i.default.cloneElement(e,{key:r})})}let g=function({children:e}){let t=(0,i.useContext)(c.HeadManagerContext);return(0,s.jsx)(d.default,{reduceComponentsToState:f,headManager:t,children:e})};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8071:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return l}});let o=r(4232),a=o.useLayoutEffect,n=o.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=o.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return a(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),a(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),n(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},8337:(e,t,r)=>{\\"use strict\\";r.d(t,{w:()=>a});var o=r(8333);function a(e,t){let r=(0,o.a)(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}},9032:(e,t,r)=>{\\"use strict\\";r.d(t,{$:()=>n});var o=r(1692),a=r(8333);function n(e,t){let r=(0,o.q)(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=(0,a.a)(e,t?.in),s=l.getDay();return l.setDate(l.getDate()+((s{\\"use strict\\";r.d(t,{A:()=>o});let o=(0,r(7161).A)(\\"map-pin\\",[[\\"path\\",{d:\\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\\",key:\\"1r0f0z\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"10\\",r:\\"3\\",key:\\"ilqhr7\\"}]])}}]);"},{"name":"763.361bd0be0cf1ba1f.js","path":"apps/web/out/_next/static/chunks/763.361bd0be0cf1ba1f.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[763],{8763:(e,t,a)=>{Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return r}});let l=a(4252),s=a(7876),u=l._(a(4232)),n=a(9313);async function o({Component:e,ctx:t}){return{pageProps:await (0,n.loadGetInitialProps)(e,t)}}class r extends u.default.Component{static{this.origGetInitialProps=o}static{this.getInitialProps=o}render(){let{Component:e,pageProps:t}=this.props;return(0,s.jsx)(e,{...t})}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}}]);"},{"name":"858-d1b1e4747ce15efa.js","path":"apps/web/out/_next/static/chunks/858-d1b1e4747ce15efa.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[858],{289:(e,t,a)=>{a.d(t,{o:()=>r});var n=a(8333);function r(e,t){let a=(0,n.a)(e,t?.in);return a.setHours(0,0,0,0),a}},397:(e,t,a)=>{a.d(t,{o:()=>o});var n=a(2146),r=a(7941),i=a(8333);function o(e,t,a){let o=((0,i.a)(e)-(0,i.a)(t))/r.Cg;return(0,n.u)(a?.roundingMethod)(o)}},973:(e,t,a)=>{a.d(t,{k:()=>i});var n=a(1692),r=a(8333);function i(e,t){let a=(0,n.q)(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,o=(0,r.a)(e,t?.in),d=o.getDay();return o.setDate(o.getDate()-(7*(d{a.d(t,{q:()=>r});let n={};function r(){return n}},2146:(e,t,a)=>{a.d(t,{u:()=>n});function n(e){return t=>{let a=(e?Math[e]:Math.trunc)(t);return 0===a?0:a}}},2423:(e,t,a)=>{a.d(t,{GP:()=>F});let n={lessThanXSeconds:{one:\\"less than a second\\",other:\\"less than {{count}} seconds\\"},xSeconds:{one:\\"1 second\\",other:\\"{{count}} seconds\\"},halfAMinute:\\"half a minute\\",lessThanXMinutes:{one:\\"less than a minute\\",other:\\"less than {{count}} minutes\\"},xMinutes:{one:\\"1 minute\\",other:\\"{{count}} minutes\\"},aboutXHours:{one:\\"about 1 hour\\",other:\\"about {{count}} hours\\"},xHours:{one:\\"1 hour\\",other:\\"{{count}} hours\\"},xDays:{one:\\"1 day\\",other:\\"{{count}} days\\"},aboutXWeeks:{one:\\"about 1 week\\",other:\\"about {{count}} weeks\\"},xWeeks:{one:\\"1 week\\",other:\\"{{count}} weeks\\"},aboutXMonths:{one:\\"about 1 month\\",other:\\"about {{count}} months\\"},xMonths:{one:\\"1 month\\",other:\\"{{count}} months\\"},aboutXYears:{one:\\"about 1 year\\",other:\\"about {{count}} years\\"},xYears:{one:\\"1 year\\",other:\\"{{count}} years\\"},overXYears:{one:\\"over 1 year\\",other:\\"over {{count}} years\\"},almostXYears:{one:\\"almost 1 year\\",other:\\"almost {{count}} years\\"}};var r=a(9385);let i={date:(0,r.k)({formats:{full:\\"EEEE, MMMM do, y\\",long:\\"MMMM do, y\\",medium:\\"MMM d, y\\",short:\\"MM/dd/yyyy\\"},defaultWidth:\\"full\\"}),time:(0,r.k)({formats:{full:\\"h:mm:ss a zzzz\\",long:\\"h:mm:ss a z\\",medium:\\"h:mm:ss a\\",short:\\"h:mm a\\"},defaultWidth:\\"full\\"}),dateTime:(0,r.k)({formats:{full:\\"{{date}} \'at\' {{time}}\\",long:\\"{{date}} \'at\' {{time}}\\",medium:\\"{{date}}, {{time}}\\",short:\\"{{date}}, {{time}}\\"},defaultWidth:\\"full\\"})},o={lastWeek:\\"\'last\' eeee \'at\' p\\",yesterday:\\"\'yesterday at\' p\\",today:\\"\'today at\' p\\",tomorrow:\\"\'tomorrow at\' p\\",nextWeek:\\"eeee \'at\' p\\",other:\\"P\\"};var d=a(6443);let u={ordinalNumber:(e,t)=>{let a=Number(e),n=a%100;if(n>20||n<10)switch(n%10){case 1:return a+\\"st\\";case 2:return a+\\"nd\\";case 3:return a+\\"rd\\"}return a+\\"th\\"},era:(0,d.o)({values:{narrow:[\\"B\\",\\"A\\"],abbreviated:[\\"BC\\",\\"AD\\"],wide:[\\"Before Christ\\",\\"Anno Domini\\"]},defaultWidth:\\"wide\\"}),quarter:(0,d.o)({values:{narrow:[\\"1\\",\\"2\\",\\"3\\",\\"4\\"],abbreviated:[\\"Q1\\",\\"Q2\\",\\"Q3\\",\\"Q4\\"],wide:[\\"1st quarter\\",\\"2nd quarter\\",\\"3rd quarter\\",\\"4th quarter\\"]},defaultWidth:\\"wide\\",argumentCallback:e=>e-1}),month:(0,d.o)({values:{narrow:[\\"J\\",\\"F\\",\\"M\\",\\"A\\",\\"M\\",\\"J\\",\\"J\\",\\"A\\",\\"S\\",\\"O\\",\\"N\\",\\"D\\"],abbreviated:[\\"Jan\\",\\"Feb\\",\\"Mar\\",\\"Apr\\",\\"May\\",\\"Jun\\",\\"Jul\\",\\"Aug\\",\\"Sep\\",\\"Oct\\",\\"Nov\\",\\"Dec\\"],wide:[\\"January\\",\\"February\\",\\"March\\",\\"April\\",\\"May\\",\\"June\\",\\"July\\",\\"August\\",\\"September\\",\\"October\\",\\"November\\",\\"December\\"]},defaultWidth:\\"wide\\"}),day:(0,d.o)({values:{narrow:[\\"S\\",\\"M\\",\\"T\\",\\"W\\",\\"T\\",\\"F\\",\\"S\\"],short:[\\"Su\\",\\"Mo\\",\\"Tu\\",\\"We\\",\\"Th\\",\\"Fr\\",\\"Sa\\"],abbreviated:[\\"Sun\\",\\"Mon\\",\\"Tue\\",\\"Wed\\",\\"Thu\\",\\"Fri\\",\\"Sat\\"],wide:[\\"Sunday\\",\\"Monday\\",\\"Tuesday\\",\\"Wednesday\\",\\"Thursday\\",\\"Friday\\",\\"Saturday\\"]},defaultWidth:\\"wide\\"}),dayPeriod:(0,d.o)({values:{narrow:{am:\\"a\\",pm:\\"p\\",midnight:\\"mi\\",noon:\\"n\\",morning:\\"morning\\",afternoon:\\"afternoon\\",evening:\\"evening\\",night:\\"night\\"},abbreviated:{am:\\"AM\\",pm:\\"PM\\",midnight:\\"midnight\\",noon:\\"noon\\",morning:\\"morning\\",afternoon:\\"afternoon\\",evening:\\"evening\\",night:\\"night\\"},wide:{am:\\"a.m.\\",pm:\\"p.m.\\",midnight:\\"midnight\\",noon:\\"noon\\",morning:\\"morning\\",afternoon:\\"afternoon\\",evening:\\"evening\\",night:\\"night\\"}},defaultWidth:\\"wide\\",formattingValues:{narrow:{am:\\"a\\",pm:\\"p\\",midnight:\\"mi\\",noon:\\"n\\",morning:\\"in the morning\\",afternoon:\\"in the afternoon\\",evening:\\"in the evening\\",night:\\"at night\\"},abbreviated:{am:\\"AM\\",pm:\\"PM\\",midnight:\\"midnight\\",noon:\\"noon\\",morning:\\"in the morning\\",afternoon:\\"in the afternoon\\",evening:\\"in the evening\\",night:\\"at night\\"},wide:{am:\\"a.m.\\",pm:\\"p.m.\\",midnight:\\"midnight\\",noon:\\"noon\\",morning:\\"in the morning\\",afternoon:\\"in the afternoon\\",evening:\\"in the evening\\",night:\\"at night\\"}},defaultFormattingWidth:\\"wide\\"})};var s=a(2805);let l={code:\\"en-US\\",formatDistance:(e,t,a)=>{let r,i=n[e];if(r=\\"string\\"==typeof i?i:1===t?i.one:i.other.replace(\\"{{count}}\\",t.toString()),a?.addSuffix)if(a.comparison&&a.comparison>0)return\\"in \\"+r;else return r+\\" ago\\";return r},formatLong:i,formatRelative:(e,t,a,n)=>o[e],localize:u,match:{ordinalNumber:(0,a(8437).K)({matchPattern:/^(\\\\d+)(th|st|nd|rd)?/i,parsePattern:/\\\\d+/i,valueCallback:e=>parseInt(e,10)}),era:(0,s.A)({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\\\\.?\\\\s?c\\\\.?|b\\\\.?\\\\s?c\\\\.?\\\\s?e\\\\.?|a\\\\.?\\\\s?d\\\\.?|c\\\\.?\\\\s?e\\\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:\\"wide\\",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:\\"any\\"}),quarter:(0,s.A)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:\\"wide\\",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:\\"any\\",valueCallback:e=>e+1}),month:(0,s.A)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:\\"wide\\",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:\\"any\\"}),day:(0,s.A)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:\\"wide\\",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:\\"any\\"}),dayPeriod:(0,s.A)({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\\\.?\\\\s?m\\\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:\\"any\\",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:\\"any\\"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var c=a(1692),m=a(8333);function h(e){let t=(0,m.a)(e),a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),e-a}var f=a(7901),g=a(7941),w=a(289),b=a(973);function y(e,t){return(0,b.k)(e,{...t,weekStartsOn:1})}var p=a(3921);function v(e,t){let a=(0,m.a)(e,t?.in),n=a.getFullYear(),r=(0,p.w)(a,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=y(r),o=(0,p.w)(a,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);let d=y(o);return a.getTime()>=i.getTime()?n+1:a.getTime()>=d.getTime()?n:n-1}function M(e,t){let a=(0,m.a)(e,t?.in),n=a.getFullYear(),r=(0,c.q)(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=(0,p.w)(t?.in||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);let d=(0,b.k)(o,t),u=(0,p.w)(t?.in||e,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);let s=(0,b.k)(u,t);return+a>=+d?n+1:+a>=+s?n:n-1}function k(e,t){let a=Math.abs(e).toString().padStart(t,\\"0\\");return(e<0?\\"-\\":\\"\\")+a}let x={y(e,t){let a=e.getFullYear(),n=a>0?a:1-a;return k(\\"yy\\"===t?n%100:n,t.length)},M(e,t){let a=e.getMonth();return\\"M\\"===t?String(a+1):k(a+1,2)},d:(e,t)=>k(e.getDate(),t.length),a(e,t){let a=e.getHours()/12>=1?\\"pm\\":\\"am\\";switch(t){case\\"a\\":case\\"aa\\":return a.toUpperCase();case\\"aaa\\":return a;case\\"aaaaa\\":return a[0];default:return\\"am\\"===a?\\"a.m.\\":\\"p.m.\\"}},h:(e,t)=>k(e.getHours()%12||12,t.length),H:(e,t)=>k(e.getHours(),t.length),m:(e,t)=>k(e.getMinutes(),t.length),s:(e,t)=>k(e.getSeconds(),t.length),S(e,t){let a=t.length;return k(Math.trunc(e.getMilliseconds()*Math.pow(10,a-3)),t.length)}},P={G:function(e,t,a){let n=+(e.getFullYear()>0);switch(t){case\\"G\\":case\\"GG\\":case\\"GGG\\":return a.era(n,{width:\\"abbreviated\\"});case\\"GGGGG\\":return a.era(n,{width:\\"narrow\\"});default:return a.era(n,{width:\\"wide\\"})}},y:function(e,t,a){if(\\"yo\\"===t){let t=e.getFullYear();return a.ordinalNumber(t>0?t:1-t,{unit:\\"year\\"})}return x.y(e,t)},Y:function(e,t,a,n){let r=M(e,n),i=r>0?r:1-r;return\\"YY\\"===t?k(i%100,2):\\"Yo\\"===t?a.ordinalNumber(i,{unit:\\"year\\"}):k(i,t.length)},R:function(e,t){return k(v(e),t.length)},u:function(e,t){return k(e.getFullYear(),t.length)},Q:function(e,t,a){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case\\"Q\\":return String(n);case\\"QQ\\":return k(n,2);case\\"Qo\\":return a.ordinalNumber(n,{unit:\\"quarter\\"});case\\"QQQ\\":return a.quarter(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"QQQQQ\\":return a.quarter(n,{width:\\"narrow\\",context:\\"formatting\\"});default:return a.quarter(n,{width:\\"wide\\",context:\\"formatting\\"})}},q:function(e,t,a){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case\\"q\\":return String(n);case\\"qq\\":return k(n,2);case\\"qo\\":return a.ordinalNumber(n,{unit:\\"quarter\\"});case\\"qqq\\":return a.quarter(n,{width:\\"abbreviated\\",context:\\"standalone\\"});case\\"qqqqq\\":return a.quarter(n,{width:\\"narrow\\",context:\\"standalone\\"});default:return a.quarter(n,{width:\\"wide\\",context:\\"standalone\\"})}},M:function(e,t,a){let n=e.getMonth();switch(t){case\\"M\\":case\\"MM\\":return x.M(e,t);case\\"Mo\\":return a.ordinalNumber(n+1,{unit:\\"month\\"});case\\"MMM\\":return a.month(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"MMMMM\\":return a.month(n,{width:\\"narrow\\",context:\\"formatting\\"});default:return a.month(n,{width:\\"wide\\",context:\\"formatting\\"})}},L:function(e,t,a){let n=e.getMonth();switch(t){case\\"L\\":return String(n+1);case\\"LL\\":return k(n+1,2);case\\"Lo\\":return a.ordinalNumber(n+1,{unit:\\"month\\"});case\\"LLL\\":return a.month(n,{width:\\"abbreviated\\",context:\\"standalone\\"});case\\"LLLLL\\":return a.month(n,{width:\\"narrow\\",context:\\"standalone\\"});default:return a.month(n,{width:\\"wide\\",context:\\"standalone\\"})}},w:function(e,t,a,n){let r,i,o,d,u,s=(r=(0,m.a)(e,n?.in),Math.round(((0,b.k)(r,n)-(i=(0,c.q)(),o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=M(r,n),(u=(0,p.w)(n?.in||r,0)).setFullYear(d,0,o),u.setHours(0,0,0,0),(0,b.k)(u,n)))/g.my)+1);return\\"wo\\"===t?a.ordinalNumber(s,{unit:\\"week\\"}):k(s,t.length)},I:function(e,t,a){let n,r,i,o=Math.round((y(n=(0,m.a)(e,void 0))-(r=v(n,void 0),(i=(0,p.w)(n,0)).setFullYear(r,0,4),i.setHours(0,0,0,0),y(i)))/g.my)+1;return\\"Io\\"===t?a.ordinalNumber(o,{unit:\\"week\\"}):k(o,t.length)},d:function(e,t,a){return\\"do\\"===t?a.ordinalNumber(e.getDate(),{unit:\\"date\\"}):x.d(e,t)},D:function(e,t,a){let n,r,i=function(e,t,a){let[n,r]=(0,f.x)(void 0,e,t),i=(0,w.o)(n),o=(0,w.o)(r);return Math.round((i-h(i)-(o-h(o)))/g.w4)}(n=(0,m.a)(e,void 0),((r=(0,m.a)(n,void 0)).setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r))+1;return\\"Do\\"===t?a.ordinalNumber(i,{unit:\\"dayOfYear\\"}):k(i,t.length)},E:function(e,t,a){let n=e.getDay();switch(t){case\\"E\\":case\\"EE\\":case\\"EEE\\":return a.day(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"EEEEE\\":return a.day(n,{width:\\"narrow\\",context:\\"formatting\\"});case\\"EEEEEE\\":return a.day(n,{width:\\"short\\",context:\\"formatting\\"});default:return a.day(n,{width:\\"wide\\",context:\\"formatting\\"})}},e:function(e,t,a,n){let r=e.getDay(),i=(r-n.weekStartsOn+8)%7||7;switch(t){case\\"e\\":return String(i);case\\"ee\\":return k(i,2);case\\"eo\\":return a.ordinalNumber(i,{unit:\\"day\\"});case\\"eee\\":return a.day(r,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"eeeee\\":return a.day(r,{width:\\"narrow\\",context:\\"formatting\\"});case\\"eeeeee\\":return a.day(r,{width:\\"short\\",context:\\"formatting\\"});default:return a.day(r,{width:\\"wide\\",context:\\"formatting\\"})}},c:function(e,t,a,n){let r=e.getDay(),i=(r-n.weekStartsOn+8)%7||7;switch(t){case\\"c\\":return String(i);case\\"cc\\":return k(i,t.length);case\\"co\\":return a.ordinalNumber(i,{unit:\\"day\\"});case\\"ccc\\":return a.day(r,{width:\\"abbreviated\\",context:\\"standalone\\"});case\\"ccccc\\":return a.day(r,{width:\\"narrow\\",context:\\"standalone\\"});case\\"cccccc\\":return a.day(r,{width:\\"short\\",context:\\"standalone\\"});default:return a.day(r,{width:\\"wide\\",context:\\"standalone\\"})}},i:function(e,t,a){let n=e.getDay(),r=0===n?7:n;switch(t){case\\"i\\":return String(r);case\\"ii\\":return k(r,t.length);case\\"io\\":return a.ordinalNumber(r,{unit:\\"day\\"});case\\"iii\\":return a.day(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"iiiii\\":return a.day(n,{width:\\"narrow\\",context:\\"formatting\\"});case\\"iiiiii\\":return a.day(n,{width:\\"short\\",context:\\"formatting\\"});default:return a.day(n,{width:\\"wide\\",context:\\"formatting\\"})}},a:function(e,t,a){let n=e.getHours()/12>=1?\\"pm\\":\\"am\\";switch(t){case\\"a\\":case\\"aa\\":return a.dayPeriod(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"aaa\\":return a.dayPeriod(n,{width:\\"abbreviated\\",context:\\"formatting\\"}).toLowerCase();case\\"aaaaa\\":return a.dayPeriod(n,{width:\\"narrow\\",context:\\"formatting\\"});default:return a.dayPeriod(n,{width:\\"wide\\",context:\\"formatting\\"})}},b:function(e,t,a){let n,r=e.getHours();switch(n=12===r?\\"noon\\":0===r?\\"midnight\\":r/12>=1?\\"pm\\":\\"am\\",t){case\\"b\\":case\\"bb\\":return a.dayPeriod(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"bbb\\":return a.dayPeriod(n,{width:\\"abbreviated\\",context:\\"formatting\\"}).toLowerCase();case\\"bbbbb\\":return a.dayPeriod(n,{width:\\"narrow\\",context:\\"formatting\\"});default:return a.dayPeriod(n,{width:\\"wide\\",context:\\"formatting\\"})}},B:function(e,t,a){let n,r=e.getHours();switch(n=r>=17?\\"evening\\":r>=12?\\"afternoon\\":r>=4?\\"morning\\":\\"night\\",t){case\\"B\\":case\\"BB\\":case\\"BBB\\":return a.dayPeriod(n,{width:\\"abbreviated\\",context:\\"formatting\\"});case\\"BBBBB\\":return a.dayPeriod(n,{width:\\"narrow\\",context:\\"formatting\\"});default:return a.dayPeriod(n,{width:\\"wide\\",context:\\"formatting\\"})}},h:function(e,t,a){if(\\"ho\\"===t){let t=e.getHours()%12;return 0===t&&(t=12),a.ordinalNumber(t,{unit:\\"hour\\"})}return x.h(e,t)},H:function(e,t,a){return\\"Ho\\"===t?a.ordinalNumber(e.getHours(),{unit:\\"hour\\"}):x.H(e,t)},K:function(e,t,a){let n=e.getHours()%12;return\\"Ko\\"===t?a.ordinalNumber(n,{unit:\\"hour\\"}):k(n,t.length)},k:function(e,t,a){let n=e.getHours();return(0===n&&(n=24),\\"ko\\"===t)?a.ordinalNumber(n,{unit:\\"hour\\"}):k(n,t.length)},m:function(e,t,a){return\\"mo\\"===t?a.ordinalNumber(e.getMinutes(),{unit:\\"minute\\"}):x.m(e,t)},s:function(e,t,a){return\\"so\\"===t?a.ordinalNumber(e.getSeconds(),{unit:\\"second\\"}):x.s(e,t)},S:function(e,t){return x.S(e,t)},X:function(e,t,a){let n=e.getTimezoneOffset();if(0===n)return\\"Z\\";switch(t){case\\"X\\":return S(n);case\\"XXXX\\":case\\"XX\\":return j(n);default:return j(n,\\":\\")}},x:function(e,t,a){let n=e.getTimezoneOffset();switch(t){case\\"x\\":return S(n);case\\"xxxx\\":case\\"xx\\":return j(n);default:return j(n,\\":\\")}},O:function(e,t,a){let n=e.getTimezoneOffset();switch(t){case\\"O\\":case\\"OO\\":case\\"OOO\\":return\\"GMT\\"+W(n,\\":\\");default:return\\"GMT\\"+j(n,\\":\\")}},z:function(e,t,a){let n=e.getTimezoneOffset();switch(t){case\\"z\\":case\\"zz\\":case\\"zzz\\":return\\"GMT\\"+W(n,\\":\\");default:return\\"GMT\\"+j(n,\\":\\")}},t:function(e,t,a){return k(Math.trunc(e/1e3),t.length)},T:function(e,t,a){return k(+e,t.length)}};function W(e,t=\\"\\"){let a=e>0?\\"-\\":\\"+\\",n=Math.abs(e),r=Math.trunc(n/60),i=n%60;return 0===i?a+String(r):a+String(r)+t+k(i,2)}function S(e,t){return e%60==0?(e>0?\\"-\\":\\"+\\")+k(Math.abs(e)/60,2):j(e,t)}function j(e,t=\\"\\"){let a=Math.abs(e);return(e>0?\\"-\\":\\"+\\")+k(Math.trunc(a/60),2)+t+k(a%60,2)}let D=(e,t)=>{switch(e){case\\"P\\":return t.date({width:\\"short\\"});case\\"PP\\":return t.date({width:\\"medium\\"});case\\"PPP\\":return t.date({width:\\"long\\"});default:return t.date({width:\\"full\\"})}},A=(e,t)=>{switch(e){case\\"p\\":return t.time({width:\\"short\\"});case\\"pp\\":return t.time({width:\\"medium\\"});case\\"ppp\\":return t.time({width:\\"long\\"});default:return t.time({width:\\"full\\"})}},C={p:A,P:(e,t)=>{let a,n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return D(e,t);switch(r){case\\"P\\":a=t.dateTime({width:\\"short\\"});break;case\\"PP\\":a=t.dateTime({width:\\"medium\\"});break;case\\"PPP\\":a=t.dateTime({width:\\"long\\"});break;default:a=t.dateTime({width:\\"full\\"})}return a.replace(\\"{{date}}\\",D(r,t)).replace(\\"{{time}}\\",A(i,t))}},T=/^D+$/,Y=/^Y+$/,q=[\\"D\\",\\"DD\\",\\"YY\\",\\"YYYY\\"],H=/[yYQqMLwIdDecihHKkms]o|(\\\\w)\\\\1*|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,N=/P+p+|P+|p+|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,O=/^\'([^]*?)\'?$/,z=/\'\'/g,E=/[a-zA-Z]/;function F(e,t,a){let n=(0,c.q)(),r=a?.locale??n.locale??l,i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,d=(0,m.a)(e,a?.in);if(!(d instanceof Date||\\"object\\"==typeof d&&\\"[object Date]\\"===Object.prototype.toString.call(d))&&\\"number\\"!=typeof d||isNaN(+(0,m.a)(d)))throw RangeError(\\"Invalid time value\\");let u=t.match(N).map(e=>{let t=e[0];return\\"p\\"===t||\\"P\\"===t?(0,C[t])(e,r.formatLong):e}).join(\\"\\").match(H).map(e=>{if(\\"\'\'\\"===e)return{isToken:!1,value:\\"\'\\"};let t=e[0];if(\\"\'\\"===t){var a;let t;return{isToken:!1,value:(t=(a=e).match(O))?t[1].replace(z,\\"\'\\"):a}}if(P[t])return{isToken:!0,value:e};if(t.match(E))throw RangeError(\\"Format string contains an unescaped latin alphabet character `\\"+t+\\"`\\");return{isToken:!1,value:e}});r.localize.preprocessor&&(u=r.localize.preprocessor(d,u));let s={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return u.map(n=>{if(!n.isToken)return n.value;let i=n.value;return(!a?.useAdditionalWeekYearTokens&&Y.test(i)||!a?.useAdditionalDayOfYearTokens&&T.test(i))&&function(e,t,a){var n,r,i;let o,d=(n=e,r=t,i=a,o=\\"Y\\"===n[0]?\\"years\\":\\"days of the month\\",`Use \\\\`${n.toLowerCase()}\\\\` instead of \\\\`${n}\\\\` (in \\\\`${r}\\\\`) for formatting ${o} to the input \\\\`${i}\\\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(d),q.includes(e))throw RangeError(d)}(i,t,String(e)),(0,P[i[0]])(d,i,r.localize,s)}).join(\\"\\")}},2680:(e,t,a)=>{a.d(t,{f:()=>i});var n=a(3921),r=a(8333);function i(e,t,a){let i=(0,r.a)(e,a?.in);return isNaN(t)?(0,n.w)(a?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}},2805:(e,t,a)=>{function n(e){return(t,a={})=>{let n,r=a.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;let d=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?function(e,t){for(let a=0;ae.test(d)):function(e,t){for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a}(u,e=>e.test(d));return n=e.valueCallback?e.valueCallback(s):s,{value:n=a.valueCallback?a.valueCallback(n):n,rest:t.slice(d.length)}}}a.d(t,{A:()=>n})},3921:(e,t,a)=>{a.d(t,{w:()=>r});var n=a(7941);function r(e,t){return\\"function\\"==typeof e?e(t):e&&\\"object\\"==typeof e&&n._P in e?e[n._P](t):e instanceof Date?new e.constructor(t):new Date(t)}},4460:(e,t,a)=>{a.d(t,{r:()=>i});var n=a(7901),r=a(289);function i(e,t,a){let[i,o]=(0,n.x)(a?.in,e,t);return+(0,r.o)(i)==+(0,r.o)(o)}},4927:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"zoom-in\\",[[\\"circle\\",{cx:\\"11\\",cy:\\"11\\",r:\\"8\\",key:\\"4ej97u\\"}],[\\"line\\",{x1:\\"21\\",x2:\\"16.65\\",y1:\\"21\\",y2:\\"16.65\\",key:\\"13gj7c\\"}],[\\"line\\",{x1:\\"11\\",x2:\\"11\\",y1:\\"8\\",y2:\\"14\\",key:\\"1vmskp\\"}],[\\"line\\",{x1:\\"8\\",x2:\\"14\\",y1:\\"11\\",y2:\\"11\\",key:\\"durymu\\"}]])},5002:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"x\\",[[\\"path\\",{d:\\"M18 6 6 18\\",key:\\"1bl5f8\\"}],[\\"path\\",{d:\\"m6 6 12 12\\",key:\\"d8bk6v\\"}]])},5079:(e,t,a)=>{a.d(t,{es:()=>m});let n={lessThanXSeconds:{one:\\"menos de un segundo\\",other:\\"menos de {{count}} segundos\\"},xSeconds:{one:\\"1 segundo\\",other:\\"{{count}} segundos\\"},halfAMinute:\\"medio minuto\\",lessThanXMinutes:{one:\\"menos de un minuto\\",other:\\"menos de {{count}} minutos\\"},xMinutes:{one:\\"1 minuto\\",other:\\"{{count}} minutos\\"},aboutXHours:{one:\\"alrededor de 1 hora\\",other:\\"alrededor de {{count}} horas\\"},xHours:{one:\\"1 hora\\",other:\\"{{count}} horas\\"},xDays:{one:\\"1 d\\\\xeda\\",other:\\"{{count}} d\\\\xedas\\"},aboutXWeeks:{one:\\"alrededor de 1 semana\\",other:\\"alrededor de {{count}} semanas\\"},xWeeks:{one:\\"1 semana\\",other:\\"{{count}} semanas\\"},aboutXMonths:{one:\\"alrededor de 1 mes\\",other:\\"alrededor de {{count}} meses\\"},xMonths:{one:\\"1 mes\\",other:\\"{{count}} meses\\"},aboutXYears:{one:\\"alrededor de 1 a\\\\xf1o\\",other:\\"alrededor de {{count}} a\\\\xf1os\\"},xYears:{one:\\"1 a\\\\xf1o\\",other:\\"{{count}} a\\\\xf1os\\"},overXYears:{one:\\"m\\\\xe1s de 1 a\\\\xf1o\\",other:\\"m\\\\xe1s de {{count}} a\\\\xf1os\\"},almostXYears:{one:\\"casi 1 a\\\\xf1o\\",other:\\"casi {{count}} a\\\\xf1os\\"}};var r=a(9385);let i={date:(0,r.k)({formats:{full:\\"EEEE, d \'de\' MMMM \'de\' y\\",long:\\"d \'de\' MMMM \'de\' y\\",medium:\\"d MMM y\\",short:\\"dd/MM/y\\"},defaultWidth:\\"full\\"}),time:(0,r.k)({formats:{full:\\"HH:mm:ss zzzz\\",long:\\"HH:mm:ss z\\",medium:\\"HH:mm:ss\\",short:\\"HH:mm\\"},defaultWidth:\\"full\\"}),dateTime:(0,r.k)({formats:{full:\\"{{date}} \'a las\' {{time}}\\",long:\\"{{date}} \'a las\' {{time}}\\",medium:\\"{{date}}, {{time}}\\",short:\\"{{date}}, {{time}}\\"},defaultWidth:\\"full\\"})},o={lastWeek:\\"\'el\' eeee \'pasado a la\' p\\",yesterday:\\"\'ayer a la\' p\\",today:\\"\'hoy a la\' p\\",tomorrow:\\"\'ma\\\\xf1ana a la\' p\\",nextWeek:\\"eeee \'a la\' p\\",other:\\"P\\"},d={lastWeek:\\"\'el\' eeee \'pasado a las\' p\\",yesterday:\\"\'ayer a las\' p\\",today:\\"\'hoy a las\' p\\",tomorrow:\\"\'ma\\\\xf1ana a las\' p\\",nextWeek:\\"eeee \'a las\' p\\",other:\\"P\\"};var u=a(6443);let s={ordinalNumber:(e,t)=>Number(e)+\\"\\\\xba\\",era:(0,u.o)({values:{narrow:[\\"AC\\",\\"DC\\"],abbreviated:[\\"AC\\",\\"DC\\"],wide:[\\"antes de cristo\\",\\"despu\\\\xe9s de cristo\\"]},defaultWidth:\\"wide\\"}),quarter:(0,u.o)({values:{narrow:[\\"1\\",\\"2\\",\\"3\\",\\"4\\"],abbreviated:[\\"T1\\",\\"T2\\",\\"T3\\",\\"T4\\"],wide:[\\"1\\\\xba trimestre\\",\\"2\\\\xba trimestre\\",\\"3\\\\xba trimestre\\",\\"4\\\\xba trimestre\\"]},defaultWidth:\\"wide\\",argumentCallback:e=>Number(e)-1}),month:(0,u.o)({values:{narrow:[\\"e\\",\\"f\\",\\"m\\",\\"a\\",\\"m\\",\\"j\\",\\"j\\",\\"a\\",\\"s\\",\\"o\\",\\"n\\",\\"d\\"],abbreviated:[\\"ene\\",\\"feb\\",\\"mar\\",\\"abr\\",\\"may\\",\\"jun\\",\\"jul\\",\\"ago\\",\\"sep\\",\\"oct\\",\\"nov\\",\\"dic\\"],wide:[\\"enero\\",\\"febrero\\",\\"marzo\\",\\"abril\\",\\"mayo\\",\\"junio\\",\\"julio\\",\\"agosto\\",\\"septiembre\\",\\"octubre\\",\\"noviembre\\",\\"diciembre\\"]},defaultWidth:\\"wide\\"}),day:(0,u.o)({values:{narrow:[\\"d\\",\\"l\\",\\"m\\",\\"m\\",\\"j\\",\\"v\\",\\"s\\"],short:[\\"do\\",\\"lu\\",\\"ma\\",\\"mi\\",\\"ju\\",\\"vi\\",\\"s\\\\xe1\\"],abbreviated:[\\"dom\\",\\"lun\\",\\"mar\\",\\"mi\\\\xe9\\",\\"jue\\",\\"vie\\",\\"s\\\\xe1b\\"],wide:[\\"domingo\\",\\"lunes\\",\\"martes\\",\\"mi\\\\xe9rcoles\\",\\"jueves\\",\\"viernes\\",\\"s\\\\xe1bado\\"]},defaultWidth:\\"wide\\"}),dayPeriod:(0,u.o)({values:{narrow:{am:\\"a\\",pm:\\"p\\",midnight:\\"mn\\",noon:\\"md\\",morning:\\"ma\\\\xf1ana\\",afternoon:\\"tarde\\",evening:\\"tarde\\",night:\\"noche\\"},abbreviated:{am:\\"AM\\",pm:\\"PM\\",midnight:\\"medianoche\\",noon:\\"mediodia\\",morning:\\"ma\\\\xf1ana\\",afternoon:\\"tarde\\",evening:\\"tarde\\",night:\\"noche\\"},wide:{am:\\"a.m.\\",pm:\\"p.m.\\",midnight:\\"medianoche\\",noon:\\"mediodia\\",morning:\\"ma\\\\xf1ana\\",afternoon:\\"tarde\\",evening:\\"tarde\\",night:\\"noche\\"}},defaultWidth:\\"wide\\",formattingValues:{narrow:{am:\\"a\\",pm:\\"p\\",midnight:\\"mn\\",noon:\\"md\\",morning:\\"de la ma\\\\xf1ana\\",afternoon:\\"de la tarde\\",evening:\\"de la tarde\\",night:\\"de la noche\\"},abbreviated:{am:\\"AM\\",pm:\\"PM\\",midnight:\\"medianoche\\",noon:\\"mediodia\\",morning:\\"de la ma\\\\xf1ana\\",afternoon:\\"de la tarde\\",evening:\\"de la tarde\\",night:\\"de la noche\\"},wide:{am:\\"a.m.\\",pm:\\"p.m.\\",midnight:\\"medianoche\\",noon:\\"mediodia\\",morning:\\"de la ma\\\\xf1ana\\",afternoon:\\"de la tarde\\",evening:\\"de la tarde\\",night:\\"de la noche\\"}},defaultFormattingWidth:\\"wide\\"})};var l=a(8437),c=a(2805);let m={code:\\"es\\",formatDistance:(e,t,a)=>{let r,i=n[e];if(r=\\"string\\"==typeof i?i:1===t?i.one:i.other.replace(\\"{{count}}\\",t.toString()),a?.addSuffix)if(a.comparison&&a.comparison>0)return\\"en \\"+r;else return\\"hace \\"+r;return r},formatLong:i,formatRelative:(e,t,a,n)=>1!==t.getHours()?d[e]:o[e],localize:s,match:{ordinalNumber:(0,l.K)({matchPattern:/^(\\\\d+)(º)?/i,parsePattern:/\\\\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,c.A)({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\\\\.?\\\\s?c\\\\.?|a\\\\.?\\\\s?e\\\\.?\\\\s?c\\\\.?|d\\\\.?\\\\s?c\\\\.?|e\\\\.?\\\\s?c\\\\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:\\"wide\\",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:\\"any\\"}),quarter:(0,c.A)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:\\"wide\\",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:\\"any\\",valueCallback:e=>e+1}),month:(0,c.A)({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:\\"wide\\",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:\\"any\\"}),day:(0,c.A)({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:\\"wide\\",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:\\"any\\"}),dayPeriod:(0,c.A)({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\\\\.?\\\\s?m\\\\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:\\"any\\",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:\\"any\\"})},options:{weekStartsOn:1,firstWeekContainsDate:1}}},6443:(e,t,a)=>{a.d(t,{o:()=>n});function n(e){return(t,a)=>{let n;if(\\"formatting\\"===(a?.context?String(a.context):\\"standalone\\")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=a?.width?String(a.width):t;n=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=a?.width?String(a.width):e.defaultWidth;n=e.values[r]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}},6850:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"chevron-right\\",[[\\"path\\",{d:\\"m9 18 6-6-6-6\\",key:\\"mthhwq\\"}]])},6945:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"chevron-left\\",[[\\"path\\",{d:\\"m15 18-6-6 6-6\\",key:\\"1wnfg3\\"}]])},7104:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"clock\\",[[\\"path\\",{d:\\"M12 6v6l4 2\\",key:\\"mmk7yg\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}]])},7901:(e,t,a)=>{a.d(t,{x:()=>r});var n=a(3921);function r(e,...t){let a=n.w.bind(null,e||t.find(e=>\\"object\\"==typeof e));return t.map(a)}},7941:(e,t,a)=>{a.d(t,{Cg:()=>i,_P:()=>d,my:()=>n,s0:()=>o,w4:()=>r});let n=6048e5,r=864e5,i=6e4,o=36e5,d=Symbol.for(\\"constructDateFrom\\")},8333:(e,t,a)=>{a.d(t,{a:()=>r});var n=a(3921);function r(e,t){return(0,n.w)(t||e,e)}},8437:(e,t,a)=>{a.d(t,{K:()=>n});function n(e){return(t,a={})=>{let n=t.match(e.matchPattern);if(!n)return null;let r=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:o=a.valueCallback?a.valueCallback(o):o,rest:t.slice(r.length)}}}},8640:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"zoom-out\\",[[\\"circle\\",{cx:\\"11\\",cy:\\"11\\",r:\\"8\\",key:\\"4ej97u\\"}],[\\"line\\",{x1:\\"21\\",x2:\\"16.65\\",y1:\\"21\\",y2:\\"16.65\\",key:\\"13gj7c\\"}],[\\"line\\",{x1:\\"8\\",x2:\\"14\\",y1:\\"11\\",y2:\\"11\\",key:\\"durymu\\"}]])},9385:(e,t,a)=>{a.d(t,{k:()=>n});function n(e){return (t={})=>{let a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}},9982:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(7161).A)(\\"search\\",[[\\"path\\",{d:\\"m21 21-4.34-4.34\\",key:\\"14j7rj\\"}],[\\"circle\\",{cx:\\"11\\",cy:\\"11\\",r:\\"8\\",key:\\"4ej97u\\"}]])}}]);"},{"name":"914-a17084a0d0a25720.js","path":"apps/web/out/_next/static/chunks/914-a17084a0d0a25720.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[914],{7914:(e,t,r)=>{let s;r.d(t,{I:()=>I});var i=r(8275),n=r(388),u=r(8444),a=r(89),h=r(1883),c=r(7149),l=r(8306),o=class extends a.Q{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#r=(0,h.T)(),this.bindMethods(),this.setOptions(t)}#e;#s=void 0;#i=void 0;#n=void 0;#u;#a;#r;#t;#h;#c;#l;#o;#d;#p;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#s.addObserver(this),d(this.#s,this.options)?this.#y():this.updateResult(),this.#R())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return p(this.#s,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return p(this.#s,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#Q(),this.#b(),this.#s.removeObserver(this)}setOptions(e){let t=this.options,r=this.#s;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&\\"boolean\\"!=typeof this.options.enabled&&\\"function\\"!=typeof this.options.enabled&&\\"boolean\\"!=typeof(0,c.Eh)(this.options.enabled,this.#s))throw Error(\\"Expected enabled to be a boolean or a callback that returns a boolean\\");this.#v(),this.#s.setOptions(this.options),t._defaulted&&!(0,c.f8)(this.options,t)&&this.#e.getQueryCache().notify({type:\\"observerOptionsUpdated\\",query:this.#s,observer:this});let s=this.hasListeners();s&&f(this.#s,r,this.options,t)&&this.#y(),this.updateResult(),s&&(this.#s!==r||(0,c.Eh)(this.options.enabled,this.#s)!==(0,c.Eh)(t.enabled,this.#s)||(0,c.d2)(this.options.staleTime,this.#s)!==(0,c.d2)(t.staleTime,this.#s))&&this.#m();let i=this.#I();s&&(this.#s!==r||(0,c.Eh)(this.options.enabled,this.#s)!==(0,c.Eh)(t.enabled,this.#s)||i!==this.#p)&&this.#g(i)}getOptimisticResult(e){var t,r;let s=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(s,e);return t=this,r=i,(0,c.f8)(t.getCurrentResult(),r)||(this.#n=i,this.#a=this.options,this.#u=this.#s.state),i}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),\\"promise\\"===r&&(this.trackProp(\\"data\\"),this.options.experimental_prefetchInRender||\\"pending\\"!==this.#r.status||this.#r.reject(Error(\\"experimental_prefetchInRender feature flag is not enabled\\"))),Reflect.get(e,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#s}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#y({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#y(e){this.#v();let t=this.#s.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c.lQ)),t}#m(){this.#Q();let e=(0,c.d2)(this.options.staleTime,this.#s);if(c.S$||this.#n.isStale||!(0,c.gn)(e))return;let t=(0,c.j3)(this.#n.dataUpdatedAt,e);this.#o=l.zs.setTimeout(()=>{this.#n.isStale||this.updateResult()},t+1)}#I(){return(\\"function\\"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#s):this.options.refetchInterval)??!1}#g(e){this.#b(),this.#p=e,!c.S$&&!1!==(0,c.Eh)(this.options.enabled,this.#s)&&(0,c.gn)(this.#p)&&0!==this.#p&&(this.#d=l.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||i.m.isFocused())&&this.#y()},this.#p))}#R(){this.#m(),this.#g(this.#I())}#Q(){this.#o&&(l.zs.clearTimeout(this.#o),this.#o=void 0)}#b(){this.#d&&(l.zs.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let r,s=this.#s,i=this.options,n=this.#n,a=this.#u,l=this.#a,o=e!==s?e.state:this.#i,{state:p}=e,R={...p},Q=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&d(e,t),a=r&&f(e,s,t,i);(n||a)&&(R={...R,...(0,u.k)(p.data,e.options)}),\\"isRestoring\\"===t._optimisticResults&&(R.fetchStatus=\\"idle\\")}let{error:b,errorUpdatedAt:v,status:m}=R;r=R.data;let I=!1;if(void 0!==t.placeholderData&&void 0===r&&\\"pending\\"===m){let e;n?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(e=n.data,I=!0):e=\\"function\\"==typeof t.placeholderData?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,void 0!==e&&(m=\\"success\\",r=(0,c.pl)(n?.data,e,t),Q=!0)}if(t.select&&void 0!==r&&!I)if(n&&r===a?.data&&t.select===this.#h)r=this.#c;else try{this.#h=t.select,r=t.select(r),r=(0,c.pl)(n?.data,r,t),this.#c=r,this.#t=null}catch(e){this.#t=e}this.#t&&(b=this.#t,r=this.#c,v=Date.now(),m=\\"error\\");let g=\\"fetching\\"===R.fetchStatus,E=\\"pending\\"===m,O=\\"error\\"===m,T=E&&g,S=void 0!==r,C={status:m,fetchStatus:R.fetchStatus,isPending:E,isSuccess:\\"success\\"===m,isError:O,isInitialLoading:T,isLoading:T,data:r,dataUpdatedAt:R.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:R.fetchFailureCount,failureReason:R.fetchFailureReason,errorUpdateCount:R.errorUpdateCount,isFetched:R.dataUpdateCount>0||R.errorUpdateCount>0,isFetchedAfterMount:R.dataUpdateCount>o.dataUpdateCount||R.errorUpdateCount>o.errorUpdateCount,isFetching:g,isRefetching:g&&!E,isLoadingError:O&&!S,isPaused:\\"paused\\"===R.fetchStatus,isPlaceholderData:Q,isRefetchError:O&&S,isStale:y(e,t),refetch:this.refetch,promise:this.#r,isEnabled:!1!==(0,c.Eh)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{\\"error\\"===C.status?e.reject(C.error):void 0!==C.data&&e.resolve(C.data)},r=()=>{t(this.#r=C.promise=(0,h.T)())},i=this.#r;switch(i.status){case\\"pending\\":e.queryHash===s.queryHash&&t(i);break;case\\"fulfilled\\":(\\"error\\"===C.status||C.data!==i.value)&&r();break;case\\"rejected\\":(\\"error\\"!==C.status||C.error!==i.reason)&&r()}}return C}updateResult(){let e=this.#n,t=this.createResult(this.#s,this.options);if(this.#u=this.#s.state,this.#a=this.options,void 0!==this.#u.data&&(this.#l=this.#s),(0,c.f8)(t,e))return;this.#n=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r=\\"function\\"==typeof t?t():t;if(\\"all\\"===r||!r&&!this.#f.size)return!0;let s=new Set(r??this.#f);return this.options.throwOnError&&s.add(\\"error\\"),Object.keys(this.#n).some(t=>this.#n[t]!==e[t]&&s.has(t))};this.#E({listeners:r()})}#v(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#s)return;let t=this.#s;this.#s=e,this.#i=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#R()}#E(e){n.jG.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#s,type:\\"observerResultsUpdated\\"})})}};function d(e,t){return!1!==(0,c.Eh)(t.enabled,e)&&void 0===e.state.data&&(\\"error\\"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&p(e,t,t.refetchOnMount)}function p(e,t,r){if(!1!==(0,c.Eh)(t.enabled,e)&&\\"static\\"!==(0,c.d2)(t.staleTime,e)){let s=\\"function\\"==typeof r?r(e):r;return\\"always\\"===s||!1!==s&&y(e,t)}return!1}function f(e,t,r,s){return(e!==t||!1===(0,c.Eh)(s.enabled,e))&&(!r.suspense||\\"error\\"!==e.state.status)&&y(e,r)}function y(e,t){return!1!==(0,c.Eh)(t.enabled,e)&&e.isStaleByTime((0,c.d2)(t.staleTime,e))}var R=r(4232),Q=r(7768);r(7876);var b=R.createContext((s=!1,{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s})),v=R.createContext(!1);v.Provider;var m=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function I(e,t){return function(e,t,r){let s=R.useContext(v),i=R.useContext(b),u=(0,Q.jE)(r),a=u.defaultQueryOptions(e);if(u.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=s?\\"isRestoring\\":\\"optimistic\\",a.suspense){let e=e=>\\"static\\"===e?e:Math.max(e??1e3,1e3),t=a.staleTime;a.staleTime=\\"function\\"==typeof t?(...r)=>e(t(...r)):e(t),\\"number\\"==typeof a.gcTime&&(a.gcTime=Math.max(a.gcTime,1e3))}(a.suspense||a.throwOnError||a.experimental_prefetchInRender)&&!i.isReset()&&(a.retryOnMount=!1),R.useEffect(()=>{i.clearReset()},[i]);let h=!u.getQueryCache().get(a.queryHash),[l]=R.useState(()=>new t(u,a)),o=l.getOptimisticResult(a),d=!s&&!1!==e.subscribed;if(R.useSyncExternalStore(R.useCallback(e=>{let t=d?l.subscribe(n.jG.batchCalls(e)):c.lQ;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(a)},[a,l]),a?.suspense&&o.isPending)throw m(a,l,i);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(0,c.GU)(r,[e.error,s])))({result:o,errorResetBoundary:i,throwOnError:a.throwOnError,query:u.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw o.error;if(u.getDefaultOptions().queries?._experimental_afterQuery?.(a,o),a.experimental_prefetchInRender&&!c.S$&&o.isLoading&&o.isFetching&&!s){let e=h?m(a,l,i):u.getQueryCache().get(a.queryHash)?.promise;e?.catch(c.lQ).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?o:l.trackResult(o)}(e,o,t)}}}]);"},{"name":"995-84db8fe815cc0d4b.js","path":"apps/web/out/_next/static/chunks/995-84db8fe815cc0d4b.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[995],{660:(e,a,s)=>{s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"file-text\\",[[\\"path\\",{d:\\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\\",key:\\"1oefj6\\"}],[\\"path\\",{d:\\"M14 2v5a1 1 0 0 0 1 1h5\\",key:\\"wfsgrz\\"}],[\\"path\\",{d:\\"M10 9H8\\",key:\\"b1mrlr\\"}],[\\"path\\",{d:\\"M16 13H8\\",key:\\"t4e002\\"}],[\\"path\\",{d:\\"M16 17H8\\",key:\\"z1uh3a\\"}]])},858:(e,a,s)=>{s.d(a,{g:()=>d});var t=s(7876),r=s(4232),l=s(9099),i=s(5176),n=s(7932);let d=(e,a=[\\"admin\\"])=>{let s=Array.isArray(a)?a:[a];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",s),a=>{let d=(0,l.useRouter)(),[o,c]=(0,r.useState)(!0),[x,m]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void d.replace(\\"/\\");m(e);try{let a=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${a}`),s.includes(a)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${a}\' no autorizado.`),d.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),d.replace(\\"/\\")}});return()=>e()},[d]),o)?(0,t.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,t.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,t.jsx)(e,{...a,currentUser:x})}}},4015:(e,a,s)=>{s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"trash-2\\",[[\\"path\\",{d:\\"M10 11v6\\",key:\\"nco0om\\"}],[\\"path\\",{d:\\"M14 11v6\\",key:\\"outv1u\\"}],[\\"path\\",{d:\\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\\",key:\\"miytrc\\"}],[\\"path\\",{d:\\"M3 6h18\\",key:\\"d0wm0j\\"}],[\\"path\\",{d:\\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\\",key:\\"e791ji\\"}]])},4104:(e,a,s)=>{s.d(a,{A:()=>r});var t=s(7876);function r({label:e,id:a,type:s=\\"text\\",rows:r=1,className:l,...i}){let n=\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 p-2 text-sm\\";return(0,t.jsxs)(\\"div\\",{className:`space-y-1 ${l}`,children:[(0,t.jsx)(\\"label\\",{htmlFor:a,className:\\"block text-sm font-medium text-gray-700\\",children:e}),\\"textarea\\"===s?(0,t.jsx)(\\"textarea\\",{id:a,className:n,rows:r,...i}):(0,t.jsx)(\\"input\\",{id:a,type:s,className:n,...i})]})}s(4232)},4893:(e,a,s)=>{s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"pen\\",[[\\"path\\",{d:\\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\\",key:\\"1a8usu\\"}]])},5049:(e,a,s)=>{s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"triangle-alert\\",[[\\"path\\",{d:\\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\\",key:\\"wmoenq\\"}],[\\"path\\",{d:\\"M12 9v4\\",key:\\"juzpu7\\"}],[\\"path\\",{d:\\"M12 17h.01\\",key:\\"p32p05\\"}]])},5246:(e,a,s)=>{s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"briefcase\\",[[\\"path\\",{d:\\"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16\\",key:\\"jecpp\\"}],[\\"rect\\",{width:\\"20\\",height:\\"14\\",x:\\"2\\",y:\\"6\\",rx:\\"2\\",key:\\"i6l2r4\\"}]])},6372:(e,a,s)=>{s.d(a,{A:()=>r});var t=s(7876);function r({label:e,id:a,children:s,className:r,...l}){return(0,t.jsxs)(\\"div\\",{className:`space-y-1 ${r}`,children:[(0,t.jsx)(\\"label\\",{htmlFor:a,className:\\"block text-sm font-medium text-gray-700\\",children:e}),(0,t.jsx)(\\"select\\",{id:a,className:\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 py-2 text-sm\\",...l,children:s})]})}s(4232)},7104:(e,a,s)=>{s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"clock\\",[[\\"path\\",{d:\\"M12 6v6l4 2\\",key:\\"mmk7yg\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}]])},8753:(e,a,s)=>{s.d(a,{A:()=>N});var t=s(7876);s(4232);var r=s(8230),l=s.n(r),i=s(9099),n=s(9423),d=s(8264),o=s(5201),c=s(9065),x=s(1538),m=s(4763),h=s(4560),p=s(8423),u=s(6068),b=s(5164),g=s(4302),y=s(3657),j=s(7932),f=s(6647);function v(){let e=(0,i.useRouter)(),{clients:a,selectedClientId:s,setClient:r}=(0,f.t)(),v=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:d.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:h.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:p.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:u.A,label:\\"Usuarios Sistema\\"}]}];return(0,t.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,t.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,t.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,t.jsxs)(\\"select\\",{value:s,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),a.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,t.jsx)(b.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,t.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,t.jsx)(l(),{href:\\"/admin/home\\",children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,t.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),v.map(a=>(0,t.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,t.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:a.title}),a.items.map(a=>(0,t.jsx)(l(),{href:a.href,children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===a.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,t.jsx)(a.icon,{size:16}),\\" \\",a.label]})},a.href))]},a.title))]}),(0,t.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,t.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,t.jsx)(y.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:a}){return(0,t.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,t.jsx)(v,{}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,t.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,t.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:a})}),(0,t.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,t.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9120:(e,a,s)=>{s.d(a,{A:()=>r});var t=s(7876);function r({primary:e=!0,children:a,className:s,disabled:r,...l}){return(0,t.jsx)(\\"button\\",{className:`px-4 py-2 rounded-lg font-semibold transition-colors duration-150 ${e?\\"bg-indigo-600 text-white hover:bg-indigo-700 disabled:bg-indigo-300\\":\\"bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:bg-gray-100\\"} ${s||\\"\\"}`,disabled:r,...l,children:a})}s(4232)},9123:(e,a,s)=>{s.d(a,{G:()=>N});var t=s(7876),r=s(4232),l=s(7932),i=s(7685),n=s(6647),d=s(4104),o=s(6372),c=s(9120),x=s(7161);let m=(0,x.A)(\\"upload\\",[[\\"path\\",{d:\\"M12 3v12\\",key:\\"1x0j5s\\"}],[\\"path\\",{d:\\"m17 8-5-5-5 5\\",key:\\"7q97r8\\"}],[\\"path\\",{d:\\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\",key:\\"ih7n3h\\"}]]);var h=s(660),p=s(7104),u=s(4893),b=s(4015),g=s(5246);let y=(0,x.A)(\\"file-spreadsheet\\",[[\\"path\\",{d:\\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\\",key:\\"1oefj6\\"}],[\\"path\\",{d:\\"M14 2v5a1 1 0 0 0 1 1h5\\",key:\\"wfsgrz\\"}],[\\"path\\",{d:\\"M8 13h2\\",key:\\"yr2amv\\"}],[\\"path\\",{d:\\"M14 13h2\\",key:\\"un5t4a\\"}],[\\"path\\",{d:\\"M8 17h2\\",key:\\"2yhykz\\"}],[\\"path\\",{d:\\"M14 17h2\\",key:\\"10kma7\\"}]]),j=(0,x.A)(\\"download\\",[[\\"path\\",{d:\\"M12 15V3\\",key:\\"m9g1x1\\"}],[\\"path\\",{d:\\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\",key:\\"ih7n3h\\"}],[\\"path\\",{d:\\"m7 10 5 5 5-5\\",key:\\"brsn70\\"}]]);var f=s(5049);let v=(0,x.A)(\\"chart-pie\\",[[\\"path\\",{d:\\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\\",key:\\"pzmjnu\\"}],[\\"path\\",{d:\\"M21.21 15.89A10 10 0 1 1 8 2.83\\",key:\\"k2fpak\\"}]]);function N(){var e;let a,{clients:s,selectedClientId:x}=(0,n.t)(),[N,A]=(0,r.useState)([]),[w,C]=(0,r.useState)(!0),[k,E]=(0,r.useState)(!1),[S,D]=(0,r.useState)(!1),[M,I]=(0,r.useState)(!1),[z,O]=(0,r.useState)(!1),T=(0,r.useRef)(null),[P,H]=(0,r.useState)(!1),[R,U]=(0,r.useState)(null),[F,V]=(0,r.useState)(null),[L,_]=(0,r.useState)(!1),[G,$]=(0,r.useState)({uid:\\"\\",name:\\"\\",email:\\"\\",password:\\"\\",role:\\"employee\\",maxHoursPerMonth:176,contractType:\\"FullTime\\",laborAgreement:\\"SUVICO\\",isAvailable:!0,clientId:\\"\\",dni:\\"\\",fileNumber:\\"\\",address:\\"\\",payrollCycleStartDay:1,payrollCycleEndDay:0}),q=async()=>{C(!0);try{let e=(await (0,l.r6)({action:\\"GET_ALL_EMPLOYEES\\",payload:{}})).data.data||[];A(e)}catch(e){console.error(e),i.Ay.error(\\"Error al cargar la n\\\\xf3mina.\\")}finally{C(!1)}};(0,r.useEffect)(()=>{q()},[]);let Y=async e=>{let a=e.target.files?.[0];if(!a)return;let s=new FileReader;s.onload=async e=>{let a=(e.target?.result).split(\\"\\\\n\\").slice(1).map(e=>{let[a,s,t,r,l,i,n,d,o]=e.split(\\",\\");return s&&t?{name:a?.trim(),email:s?.trim(),dni:t?.trim(),legajo:r?.trim(),direccion:l?.trim(),convenio:i?.trim(),modalidad:n?.trim(),horas_mensuales:d?.trim(),inicio_ciclo:o?.trim()}:null}).filter(Boolean);if(0===a.length)return void i.Ay.error(\\"El archivo parece estar vac\\\\xedo o tiene formato incorrecto.\\");if(!confirm(`Se encontraron ${a.length} registros v\\\\xe1lidos.\\n\\\\xbfProceder con la importaci\\\\xf3n?\\n\\nNota: La contrase\\\\xf1a inicial ser\\\\xe1 el DNI.`))return;let s=i.Ay.loading(`Importando ${a.length} empleados...`);try{let e=(await (0,l.r6)({action:\\"IMPORT_EMPLOYEES\\",payload:{rows:a}})).data.data;i.Ay.success(`Importaci\\\\xf3n finalizada.\\n✅ \\\\xc9xitos: ${e.success}`,{id:s,duration:5e3}),e.errors.length>0&&(console.warn(\\"Errores de importaci\\\\xf3n:\\",e.errors),(0,i.Ay)(\\"Hubo algunos errores, revise la consola.\\",{icon:\\"⚠️\\"})),D(!1),q()}catch(e){i.Ay.error(\\"Error cr\\\\xedtico en importaci\\\\xf3n: \\"+e.message,{id:s})}T.current&&(T.current.value=\\"\\")},s.readAsText(a)},B=async e=>{U(e),H(!0),_(!0),V(null);try{let a=new Date,s=await (0,l.r6)({action:\\"GET_WORKLOAD_REPORT\\",payload:{uid:e.uid,month:a.getMonth()+1,year:a.getFullYear()}});V(s.data.data)}catch(e){i.Ay.error(\\"Error al cargar reporte: \\"+e.message)}finally{_(!1)}},J=async e=>{e.preventDefault(),O(!0);let a=i.Ay.loading(M?\\"Actualizando...\\":\\"Creando recurso...\\");try{if(M){let e={name:G.name,role:G.role,maxHoursPerMonth:Number(G.maxHoursPerMonth),contractType:G.contractType,laborAgreement:G.laborAgreement,isAvailable:G.isAvailable,clientId:G.clientId,dni:G.dni,fileNumber:G.fileNumber,address:G.address,payrollCycleStartDay:Number(G.payrollCycleStartDay),payrollCycleEndDay:Number(G.payrollCycleEndDay)};await (0,l.r6)({action:\\"UPDATE_EMPLOYEE\\",payload:{uid:G.uid,data:e}}),i.Ay.success(\\"Ficha actualizada correctamente\\",{id:a})}else await (0,l.callCreateUser)({email:G.email,password:G.password,name:G.name,role:G.role,clientId:G.clientId,dni:G.dni,fileNumber:G.fileNumber,address:G.address}),i.Ay.success(\\"Empleado creado exitosamente\\",{id:a});E(!1),q()}catch(e){console.error(e),i.Ay.error(`Error: ${e.message}`,{id:a})}finally{O(!1)}},K=async e=>{if(confirm(\\"\\\\xbfEliminar este empleado? Esta acci\\\\xf3n borrar\\\\xe1 su acceso.\\"))try{await (0,l.r6)({action:\\"DELETE_EMPLOYEE\\",payload:{uid:e}}),i.Ay.success(\\"Empleado eliminado\\"),q()}catch(e){i.Ay.error(\\"Error al eliminar\\")}};return(0,t.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex justify-between items-center bg-white p-4 rounded-xl border border-gray-200 shadow-sm\\",children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h2\\",{className:\\"text-xl font-bold text-gray-800\\",children:\\"N\\\\xf3mina Global de Personal\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-sm text-gray-500\\",children:\\"Gesti\\\\xf3n del pool de recursos de la agencia.\\"})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex gap-3\\",children:[(0,t.jsxs)(c.A,{onClick:()=>D(!0),className:\\"bg-white text-slate-700 border border-slate-300 hover:bg-slate-50 flex items-center gap-2 shadow-sm\\",children:[(0,t.jsx)(m,{size:18,className:\\"text-green-600\\"}),\\" Importar CSV\\"]}),(0,t.jsxs)(c.A,{onClick:()=>{$({uid:\\"\\",name:\\"\\",email:\\"\\",password:\\"\\",role:\\"employee\\",maxHoursPerMonth:176,contractType:\\"FullTime\\",laborAgreement:\\"SUVICO\\",isAvailable:!0,clientId:x||\\"\\",dni:\\"\\",fileNumber:\\"\\",address:\\"\\",payrollCycleStartDay:1,payrollCycleEndDay:0}),I(!1),E(!0)},primary:!0,className:\\"flex items-center gap-2 shadow-sm\\",children:[(0,t.jsx)(\\"span\\",{className:\\"text-lg font-bold\\",children:\\"+\\"}),\\" Nuevo Recurso\\"]})]})]}),(0,t.jsx)(\\"div\\",{className:\\"bg-white shadow-sm rounded-xl border border-gray-200 overflow-hidden\\",children:(0,t.jsxs)(\\"div\\",{className:\\"overflow-x-auto\\",children:[(0,t.jsxs)(\\"table\\",{className:\\"min-w-full divide-y divide-gray-200\\",children:[(0,t.jsx)(\\"thead\\",{className:\\"bg-gray-50\\",children:(0,t.jsxs)(\\"tr\\",{children:[(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Legajo / Nombre\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Asignaci\\\\xf3n\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Convenio\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Estado\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-right text-xs font-bold text-gray-500 uppercase\\",children:\\"Acciones\\"})]})}),(0,t.jsx)(\\"tbody\\",{className:\\"bg-white divide-y divide-gray-200\\",children:N.map(e=>(0,t.jsxs)(\\"tr\\",{className:\\"hover:bg-gray-50 transition-colors\\",children:[(0,t.jsxs)(\\"td\\",{onClick:()=>B(e),className:\\"px-6 py-4 whitespace-nowrap cursor-pointer hover:bg-indigo-50/50\\",title:\\"Ver auditor\\\\xeda de horas\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"text-xs text-gray-400 font-mono mb-0.5\\",children:[\\"#\\",e.fileNumber||\\"S/N\\"]}),(0,t.jsx)(\\"div\\",{className:\\"text-sm font-bold text-gray-900\\",children:e.name}),(0,t.jsx)(\\"div\\",{className:\\"text-xs text-indigo-600 capitalize\\",children:e.role})]}),(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(e=>{if(!e)return(0,t.jsx)(\\"span\\",{className:\\"text-gray-400 italic\\",children:\\"Sin Asignaci\\\\xf3n (Pool)\\"});let a=s.find(a=>a.id===e);return a?(0,t.jsx)(\\"span\\",{className:\\"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-indigo-50 text-indigo-700 border border-indigo-100\\",children:a.businessName}):(0,t.jsx)(\\"span\\",{className:\\"text-red-400\\",children:\\"Cliente desconocido\\"})})(e.clientId)}),(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,t.jsxs)(\\"span\\",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${\\"SUVICO\\"===e.laborAgreement?\\"bg-blue-50 text-blue-700 border-blue-200\\":\\"UOCRA\\"===e.laborAgreement?\\"bg-orange-50 text-orange-700 border-orange-200\\":\\"bg-slate-100 text-slate-600 border-slate-200\\"}`,children:[(0,t.jsx)(h.A,{size:10,className:\\"mr-1.5\\"}),e.laborAgreement||\\"SUVICO\\"]})}),(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap text-sm\\",children:e.isAvailable?(0,t.jsx)(\\"span\\",{className:\\"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800\\",children:\\"Activo\\"}):(0,t.jsx)(\\"span\\",{className:\\"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800\\",children:\\"Inactivo\\"})}),(0,t.jsxs)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap text-right text-sm font-medium flex justify-end items-center gap-2\\",children:[(0,t.jsxs)(\\"button\\",{onClick:()=>B(e),className:\\"text-blue-600 hover:text-blue-900 mr-2 font-semibold flex items-center bg-blue-50 px-2 py-1.5 rounded hover:bg-blue-100 transition-colors\\",title:\\"Ver Horas\\",children:[(0,t.jsx)(p.A,{size:14,className:\\"mr-1\\"}),\\" Horas\\"]}),(0,t.jsx)(\\"button\\",{onClick:()=>{$({uid:e.uid,name:e.name,email:e.email,password:\\"\\",role:e.role,maxHoursPerMonth:e.maxHoursPerMonth||176,contractType:e.contractType||\\"FullTime\\",laborAgreement:e.laborAgreement||\\"SUVICO\\",isAvailable:e.isAvailable,clientId:e.clientId||\\"\\",dni:e.dni||\\"\\",fileNumber:e.fileNumber||\\"\\",address:e.address||\\"\\",payrollCycleStartDay:e.payrollCycleStartDay||1,payrollCycleEndDay:e.payrollCycleEndDay||0}),I(!0),E(!0)},className:\\"text-gray-500 hover:text-indigo-600 p-1.5 hover:bg-gray-100 rounded-lg transition-colors\\",title:\\"Editar\\",children:(0,t.jsx)(u.A,{size:18})}),(0,t.jsx)(\\"button\\",{onClick:()=>K(e.uid),className:\\"text-gray-400 hover:text-red-600 p-1.5 hover:bg-gray-100 rounded-lg transition-colors\\",title:\\"Eliminar\\",children:(0,t.jsx)(b.A,{size:18})})]})]},e.uid))})]}),!w&&0===N.length&&(0,t.jsxs)(\\"div\\",{className:\\"p-12 text-center text-gray-500 flex flex-col items-center\\",children:[(0,t.jsx)(g.A,{size:48,className:\\"text-gray-300 mb-3\\"}),(0,t.jsx)(\\"p\\",{children:\\"No hay empleados registrados en el sistema.\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-sm mt-2\\",children:\'Utilice el bot\\\\xf3n \\"Nuevo\\" o \\"Importar CSV\\".\'})]})]})}),S&&(0,t.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 overflow-y-auto bg-black/50 flex items-center justify-center p-4 backdrop-blur-sm animate-in fade-in duration-200\\",children:(0,t.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-2xl max-w-lg w-full p-6 border border-gray-100 transform scale-100 transition-all\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex justify-between items-center mb-6 border-b pb-4\\",children:[(0,t.jsxs)(\\"h3\\",{className:\\"text-xl font-bold text-gray-800 flex items-center gap-2\\",children:[(0,t.jsx)(y,{className:\\"text-green-600\\"}),\\" Importaci\\\\xf3n Masiva\\"]}),(0,t.jsx)(\\"button\\",{onClick:()=>D(!1),className:\\"text-gray-400 hover:text-gray-600 transition-colors\\",children:\\"✕\\"})]}),(0,t.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"bg-blue-50 p-4 rounded-lg border border-blue-100 text-sm text-blue-800\\",children:[(0,t.jsxs)(\\"p\\",{className:\\"font-bold mb-2 flex items-center gap-2\\",children:[(0,t.jsx)(g.A,{size:16}),\\" Instrucciones:\\"]}),(0,t.jsxs)(\\"ul\\",{className:\\"list-disc list-inside space-y-1 ml-1 text-blue-700\\",children:[(0,t.jsx)(\\"li\\",{children:\\"Descargue la plantilla CSV modelo.\\"}),(0,t.jsx)(\\"li\\",{children:\\"Complete los datos respetando las columnas.\\"}),(0,t.jsxs)(\\"li\\",{children:[\\"La \\",(0,t.jsx)(\\"strong\\",{children:\\"contrase\\\\xf1a inicial\\"}),\\" ser\\\\xe1 el DNI del empleado.\\"]})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex gap-4\\",children:[(0,t.jsxs)(\\"button\\",{onClick:()=>{let e=new Blob([\\"nombre,email,dni,legajo,direccion,convenio,modalidad,horas_mensuales,inicio_ciclo\\\\nJuan Perez,juan@mail.com,12345678,L-100,Av Colon 500,SUVICO,FullTime,176,1\\"],{type:\\"text/csv\\"}),a=window.URL.createObjectURL(e),s=document.createElement(\\"a\\");s.href=a,s.download=\\"plantilla_empleados.csv\\",s.click()},className:\\"flex-1 flex items-center justify-center gap-2 py-3 border-2 border-dashed border-gray-300 rounded-xl hover:border-indigo-500 hover:bg-indigo-50 transition-colors text-gray-600 font-medium\\",children:[(0,t.jsx)(j,{size:20}),\\" Descargar Plantilla\\"]}),(0,t.jsxs)(\\"label\\",{className:\\"flex-1 flex items-center justify-center gap-2 py-3 bg-indigo-600 text-white rounded-xl hover:bg-indigo-700 transition-colors font-bold cursor-pointer shadow-md active:scale-95\\",children:[(0,t.jsx)(m,{size:20}),\\" Subir Archivo\\",(0,t.jsx)(\\"input\\",{type:\\"file\\",accept:\\".csv\\",className:\\"hidden\\",ref:T,onChange:Y})]})]})]})]})}),k&&(0,t.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 overflow-y-auto bg-gray-900 bg-opacity-50 flex items-center justify-center p-4 backdrop-blur-sm\\",children:(0,t.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-2xl max-w-2xl w-full p-6 border border-gray-100 transform transition-all\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex justify-between items-center mb-6 border-b border-gray-100 pb-4\\",children:[(0,t.jsx)(\\"h3\\",{className:\\"text-xl font-bold text-gray-800\\",children:M?\\"Editar Ficha\\":\\"Alta de Personal\\"}),(0,t.jsx)(\\"button\\",{onClick:()=>E(!1),className:\\"text-gray-400 hover:text-gray-600\\",children:\\"✕\\"})]}),(0,t.jsxs)(\\"form\\",{onSubmit:J,className:\\"grid grid-cols-1 md:grid-cols-2 gap-5\\",children:[(0,t.jsx)(\\"div\\",{className:\\"md:col-span-2\\",children:(0,t.jsx)(\\"h4\\",{className:\\"text-xs font-bold text-indigo-600 uppercase tracking-wider mb-3\\",children:\\"Informaci\\\\xf3n Personal\\"})}),(0,t.jsx)(d.A,{label:\\"Nombre Completo\\",id:\\"name\\",value:G.name,onChange:e=>$({...G,name:e.target.value}),required:!0}),(0,t.jsx)(d.A,{label:\\"DNI\\",id:\\"dni\\",value:G.dni,onChange:e=>$({...G,dni:e.target.value}),required:!0,placeholder:\\"Sin puntos\\"}),(0,t.jsx)(\\"div\\",{className:\\"md:col-span-2\\",children:(0,t.jsx)(d.A,{label:\\"Direcci\\\\xf3n Real\\",id:\\"address\\",value:G.address,onChange:e=>$({...G,address:e.target.value}),required:!0})}),!M&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(\\"div\\",{className:\\"md:col-span-2 mt-2\\",children:(0,t.jsx)(\\"h4\\",{className:\\"text-xs font-bold text-indigo-600 uppercase tracking-wider mb-3\\",children:\\"Acceso al Sistema\\"})}),(0,t.jsx)(d.A,{label:\\"Email\\",id:\\"email\\",type:\\"email\\",value:G.email,onChange:e=>$({...G,email:e.target.value}),required:!0}),(0,t.jsx)(d.A,{label:\\"Contrase\\\\xf1a Inicial\\",id:\\"password\\",type:\\"password\\",value:G.password,onChange:e=>$({...G,password:e.target.value}),required:!0})]}),(0,t.jsx)(\\"div\\",{className:\\"md:col-span-2 mt-2\\",children:(0,t.jsx)(\\"h4\\",{className:\\"text-xs font-bold text-indigo-600 uppercase tracking-wider mb-3\\",children:\\"Contrataci\\\\xf3n y Asignaci\\\\xf3n\\"})}),(0,t.jsx)(d.A,{label:\\"Nro. Legajo\\",id:\\"fileNumber\\",value:G.fileNumber,onChange:e=>$({...G,fileNumber:e.target.value}),required:!0}),(0,t.jsxs)(o.A,{label:\\"Empresa Principal (Opcional)\\",id:\\"clientId\\",value:G.clientId,onChange:e=>$({...G,clientId:e.target.value}),children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"-- Sin Asignaci\\\\xf3n (Pool) --\\"}),s.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName},e.id))]}),(0,t.jsxs)(o.A,{label:\\"Convenio Colectivo\\",id:\\"laborAgreement\\",value:G.laborAgreement,onChange:e=>$({...G,laborAgreement:e.target.value}),children:[(0,t.jsx)(\\"option\\",{value:\\"SUVICO\\",children:\\"Seguridad (SUVICO)\\"}),(0,t.jsx)(\\"option\\",{value:\\"COMERCIO\\",children:\\"Administrativos (Comercio)\\"}),(0,t.jsx)(\\"option\\",{value:\\"UOCRA\\",children:\\"Construcci\\\\xf3n (UOCRA)\\"}),(0,t.jsx)(\\"option\\",{value:\\"FUERA_CONVENIO\\",children:\\"Fuera de Convenio\\"})]}),(0,t.jsxs)(o.A,{label:\\"Modalidad\\",id:\\"contract\\",value:G.contractType,onChange:e=>$({...G,contractType:e.target.value}),children:[(0,t.jsx)(\\"option\\",{value:\\"FullTime\\",children:\\"Full Time\\"}),(0,t.jsx)(\\"option\\",{value:\\"PartTime\\",children:\\"Part Time\\"}),(0,t.jsx)(\\"option\\",{value:\\"Eventual\\",children:\\"Eventual\\"})]}),(0,t.jsx)(d.A,{label:\\"L\\\\xedmite Horas Mensual\\",id:\\"maxHours\\",type:\\"number\\",value:G.maxHoursPerMonth,onChange:e=>$({...G,maxHoursPerMonth:Number(e.target.value)}),required:!0}),(0,t.jsxs)(\\"div\\",{className:\\"md:col-span-2 border p-3 rounded-lg bg-yellow-50/50 border-yellow-200\\",children:[(0,t.jsx)(\\"h5\\",{className:\\"text-xs font-bold text-yellow-800 mb-2\\",children:\\"Ciclo de N\\\\xf3mina\\"}),(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,t.jsxs)(o.A,{label:\\"D\\\\xeda Inicio de Ciclo\\",id:\\"cycleStart\\",value:G.payrollCycleStartDay,onChange:e=>$({...G,payrollCycleStartDay:Number(e.target.value)}),children:[(0,t.jsx)(\\"option\\",{value:1,children:\\"D\\\\xeda 1 (Calendario Est\\\\xe1ndar)\\"}),Array.from({length:31},(e,a)=>a+1).map(e=>(0,t.jsxs)(\\"option\\",{value:e,children:[\\"D\\\\xeda \\",e]},e))]}),(0,t.jsxs)(o.A,{label:\\"D\\\\xeda Fin de Ciclo\\",id:\\"cycleEnd\\",value:G.payrollCycleEndDay,onChange:e=>$({...G,payrollCycleEndDay:Number(e.target.value)}),children:[(0,t.jsx)(\\"option\\",{value:0,children:\\"\\\\xdaltimo D\\\\xeda del Mes (Est\\\\xe1ndar)\\"}),Array.from({length:31},(e,a)=>a+1).map(e=>(0,t.jsxs)(\\"option\\",{value:e,children:[\\"D\\\\xeda \\",e]},e))]})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"md:col-span-2 flex justify-end space-x-3 mt-6 border-t pt-4\\",children:[(0,t.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>E(!1),className:\\"px-5 py-2.5 text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 font-medium transition\\",children:\\"Cancelar\\"}),(0,t.jsx)(c.A,{type:\\"submit\\",primary:!0,disabled:z,children:z?\\"Guardando...\\":\\"Guardar Ficha\\"})]})]})]})}),P&&R&&(0,t.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 overflow-y-auto bg-gray-900 bg-opacity-50 flex items-center justify-center p-4 backdrop-blur-sm animate-in fade-in duration-200\\",children:(0,t.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-2xl max-w-3xl w-full p-6 border border-gray-100 transform transition-all scale-100\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex justify-between items-center mb-6 border-b border-gray-100 pb-4\\",children:[(0,t.jsx)(\\"h3\\",{className:\\"text-xl font-bold text-gray-800\\",children:\\"Ficha de Recurso y Auditor\\\\xeda de Horas\\"}),(0,t.jsx)(\\"button\\",{onClick:()=>H(!1),className:\\"text-gray-400 hover:text-gray-600 transition-colors\\",children:\\"✕\\"})]}),(0,t.jsxs)(\\"h4\\",{className:\\"text-lg font-bold text-indigo-700 mb-4\\",children:[R.name,\\" (\\",R.dni,\\")\\"]}),L?(0,t.jsx)(\\"div\\",{className:\\"p-10 text-center text-gray-500 animate-pulse\\",children:\\"Calculando reporte del mes...\\"}):F?(0,t.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4 text-sm\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"p-3 bg-gray-50 rounded\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-xs text-gray-500 font-bold uppercase\\",children:\\"Legajo / Email\\"}),(0,t.jsxs)(\\"p\\",{children:[R.fileNumber||\\"S/N\\",\\" / \\",R.email]})]}),(0,t.jsxs)(\\"div\\",{className:\\"p-3 bg-gray-50 rounded\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-xs text-gray-500 font-bold uppercase\\",children:\\"Direcci\\\\xf3n\\"}),(0,t.jsx)(\\"p\\",{children:R.address||\\"N/A\\"})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"p-3 bg-indigo-50 rounded-xl border border-indigo-100\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-xs font-bold text-indigo-600 uppercase\\",children:\\"Per\\\\xedodo de C\\\\xe1lculo\\"}),(0,t.jsxs)(\\"p\\",{className:\\"text-sm mt-1\\",children:[F.cycleStart,\\" al \\",F.cycleEnd,(0,t.jsx)(\\"span\\",{className:\\"text-xs text-gray-500 ml-2\\",children:\\"(Definido por Ciclo de N\\\\xf3mina)\\"})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-3 gap-4\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"p-4 bg-indigo-50 rounded-xl border border-indigo-100\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-xs font-bold text-indigo-600 uppercase\\",children:\\"L\\\\xedmite Contratado\\"}),(0,t.jsxs)(\\"p\\",{className:\\"text-2xl font-bold mt-1\\",children:[F.maxHours,\\" hs\\"]})]}),(0,t.jsxs)(\\"div\\",{className:\\"p-4 bg-yellow-50 rounded-xl border border-yellow-100\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-xs font-bold text-yellow-600 uppercase\\",children:\\"Horas Asignadas\\"}),(0,t.jsxs)(\\"p\\",{className:\\"text-2xl font-bold mt-1\\",children:[F.assignedHours,\\" hs\\"]}),F.assignedHours>F.maxHours?(0,t.jsxs)(\\"p\\",{className:\\"text-[10px] text-red-600 font-bold mt-1 flex items-center\\",children:[(0,t.jsx)(f.A,{size:12}),\\" \\\\xa1EXCESO DETECTADO!\\"]}):(0,t.jsx)(\\"p\\",{className:\\"text-[10px] text-green-600 font-bold mt-1\\",children:\\"Dentro de l\\\\xedmite\\"})]}),(0,t.jsxs)(\\"div\\",{className:\\"p-4 bg-green-50 rounded-xl border border-green-100\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-xs font-bold text-green-600 uppercase\\",children:\\"Horas Trabajadas (Completed)\\"}),(0,t.jsxs)(\\"p\\",{className:\\"text-2xl font-bold mt-1\\",children:[F.completedHours,\\" hs\\"]})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-4 rounded-xl border border-slate-200\\",children:[(0,t.jsxs)(\\"h5\\",{className:\\"text-xs font-bold text-slate-500 uppercase mb-3 flex items-center gap-2\\",children:[(0,t.jsx)(v,{size:14}),\\" Distribuci\\\\xf3n por Objetivo\\"]}),(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 md:grid-cols-3 gap-3\\",children:[(e=F.details,a={},e.forEach(e=>{let s=\\"Sede\\"===e.objectiveName?\\"Sede (Gen\\\\xe9rico)\\":e.objectiveName;a[s]=(a[s]||0)+e.duration}),Object.entries(a).map(([e,a])=>({name:e,hours:a}))).map((e,a)=>(0,t.jsxs)(\\"div\\",{className:\\"bg-white p-3 rounded-lg border border-slate-100 shadow-sm flex justify-between items-center\\",children:[(0,t.jsx)(\\"span\\",{className:\\"text-xs font-bold text-slate-700 truncate max-w-[100px]\\",title:e.name,children:e.name}),(0,t.jsxs)(\\"span\\",{className:\\"text-sm font-mono font-bold text-indigo-600\\",children:[e.hours,\\"h\\"]})]},a)),0===F.details.length&&(0,t.jsx)(\\"span\\",{className:\\"text-xs text-gray-400 italic col-span-3\\",children:\\"Sin actividad registrada.\\"})]})]}),(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h5\\",{className:\\"text-sm font-bold text-gray-700 mb-3 border-b pb-1\\",children:\\"Detalle Diario de Asignaciones\\"}),(0,t.jsx)(\\"div\\",{className:\\"h-48 overflow-y-auto border border-gray-200 rounded-lg\\",children:(0,t.jsxs)(\\"table\\",{className:\\"min-w-full divide-y divide-gray-200\\",children:[(0,t.jsx)(\\"thead\\",{className:\\"bg-gray-50 sticky top-0\\",children:(0,t.jsxs)(\\"tr\\",{children:[(0,t.jsx)(\\"th\\",{className:\\"px-4 py-2 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Fecha\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-4 py-2 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Duraci\\\\xf3n\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-4 py-2 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Objetivo\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-4 py-2 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Estado\\"})]})}),(0,t.jsx)(\\"tbody\\",{className:\\"bg-white divide-y divide-gray-200\\",children:F.details.map((e,a)=>(0,t.jsxs)(\\"tr\\",{className:\\"Completed\\"===e.status?\\"text-gray-600 bg-gray-50\\":\\"font-medium hover:bg-slate-50\\",children:[(0,t.jsxs)(\\"td\\",{className:\\"px-4 py-2 whitespace-nowrap text-xs\\",children:[e.date,\\" (\\",e.startTime,\\")\\"]}),(0,t.jsxs)(\\"td\\",{className:\\"px-4 py-2 whitespace-nowrap text-xs\\",children:[e.duration,\\" hs\\"]}),(0,t.jsx)(\\"td\\",{className:\\"px-4 py-2 whitespace-nowrap text-xs font-bold text-slate-700\\",children:e.objectiveName}),(0,t.jsx)(\\"td\\",{className:\\"px-4 py-2 whitespace-nowrap\\",children:(0,t.jsx)(\\"span\\",{className:`px-2 inline-flex text-[10px] leading-5 font-semibold rounded-full ${\\"Assigned\\"===e.status?\\"bg-blue-100 text-blue-800\\":\\"bg-green-100 text-green-800\\"}`,children:e.status})})]},a))})]})})]})]}):null,(0,t.jsx)(\\"div\\",{className:\\"mt-6 flex justify-end\\",children:(0,t.jsx)(\\"button\\",{onClick:()=>H(!1),className:\\"px-4 py-2 text-slate-700 bg-slate-100 rounded-lg hover:bg-slate-200 font-medium transition-colors\\",children:\\"Cerrar Ficha\\"})})]})})]})}}}]);"},{"name":"e098907b-6340bd47700d3b58.js","path":"apps/web/out/_next/static/chunks/e098907b-6340bd47700d3b58.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[759],{2945:(e,t,s)=>{let n;s.d(t,{Fu:()=>e5,KD:()=>F,pH:()=>ep,u6:()=>O});var o,i,r,a,l,u,p,c,h,d,g=s(7876),m=s(4232),v=s(8477);function f(e){return(f=\\"function\\"==typeof Symbol&&\\"symbol\\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\\"function\\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\\"symbol\\":typeof e})(e)}function y(e,t,s){var n;return(n=function(e,t){if(\\"object\\"!=f(e)||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,t||\\"default\\");if(\\"object\\"!=f(n))return n;throw TypeError(\\"@@toPrimitive must return a primitive value.\\")}return(\\"string\\"===t?String:Number)(e)}(t,\\"string\\"),(t=\\"symbol\\"==f(n)?n:n+\\"\\")in e)?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\\"default\\")?e.default:e}var L=b(l?a:(l=1,a=function(e,t,s,n,o,i,r,a){if(!e){var l;if(void 0===t)l=Error(\\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\\");else{var u=[s,n,o,i,r,a],p=0;(l=Error(t.replace(/%s/g,function(){return u[p++]}))).name=\\"Invariant Violation\\"}throw l.framesToPop=1,l}})),E=(0,m.createContext)(null);function w(e){google.maps.event.removeListener(e)}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(w)}function x(e){var t,s,n,o,{updaterMap:i,eventMap:r,prevProps:a,nextProps:l,instance:u}=e,p=(t=function(e,t,s){return\\"function\\"==typeof l[s]&&e.push(google.maps.event.addListener(u,t,l[s])),e},s=[],Object.keys(r).reduce(function(e,s){return t(e,r[s],s)},s));return n={},o=(e,t)=>{var s=l[t];s!==a[t]&&(n[t]=s,e(u,s))},Object.keys(i).forEach(e=>o(i[e],e)),p}var M={onDblClick:\\"dblclick\\",onDragEnd:\\"dragend\\",onDragStart:\\"dragstart\\",onMapTypeIdChanged:\\"maptypeid_changed\\",onMouseMove:\\"mousemove\\",onMouseOut:\\"mouseout\\",onMouseOver:\\"mouseover\\",onMouseDown:\\"mousedown\\",onMouseUp:\\"mouseup\\",onRightClick:\\"rightclick\\",onTilesLoaded:\\"tilesloaded\\",onBoundsChanged:\\"bounds_changed\\",onCenterChanged:\\"center_changed\\",onClick:\\"click\\",onDrag:\\"drag\\",onHeadingChanged:\\"heading_changed\\",onIdle:\\"idle\\",onProjectionChanged:\\"projection_changed\\",onResize:\\"resize\\",onTiltChanged:\\"tilt_changed\\",onZoomChanged:\\"zoom_changed\\"},k={extraMapTypes(e,t){t.forEach(function(t,s){e.mapTypes.set(String(s),t)})},center(e,t){e.setCenter(t)},clickableIcons(e,t){e.setClickableIcons(t)},heading(e,t){e.setHeading(t)},mapTypeId(e,t){e.setMapTypeId(t)},options(e,t){e.setOptions(t)},streetView(e,t){e.setStreetView(t)},tilt(e,t){e.setTilt(t)},zoom(e,t){e.setZoom(t)}};(0,m.memo)(function(e){var{children:t,options:s,id:n,mapContainerStyle:o,mapContainerClassName:i,center:r,onClick:a,onDblClick:l,onDrag:u,onDragEnd:p,onDragStart:c,onMouseMove:h,onMouseOut:d,onMouseOver:v,onMouseDown:f,onMouseUp:y,onRightClick:b,onCenterChanged:L,onLoad:w,onUnmount:C}=e,[x,M]=(0,m.useState)(null),k=(0,m.useRef)(null),[O,P]=(0,m.useState)(null),[S,j]=(0,m.useState)(null),[I,D]=(0,m.useState)(null),[_,B]=(0,m.useState)(null),[T,R]=(0,m.useState)(null),[z,A]=(0,m.useState)(null),[U,Z]=(0,m.useState)(null),[V,W]=(0,m.useState)(null),[N,H]=(0,m.useState)(null),[G,F]=(0,m.useState)(null),[Y,K]=(0,m.useState)(null),[q,J]=(0,m.useState)(null);return(0,m.useEffect)(()=>{s&&null!==x&&x.setOptions(s)},[x,s]),(0,m.useEffect)(()=>{null!==x&&void 0!==r&&x.setCenter(r)},[x,r]),(0,m.useEffect)(()=>{x&&l&&(null!==S&&google.maps.event.removeListener(S),j(google.maps.event.addListener(x,\\"dblclick\\",l)))},[l]),(0,m.useEffect)(()=>{x&&p&&(null!==I&&google.maps.event.removeListener(I),D(google.maps.event.addListener(x,\\"dragend\\",p)))},[p]),(0,m.useEffect)(()=>{x&&c&&(null!==_&&google.maps.event.removeListener(_),B(google.maps.event.addListener(x,\\"dragstart\\",c)))},[c]),(0,m.useEffect)(()=>{x&&f&&(null!==T&&google.maps.event.removeListener(T),R(google.maps.event.addListener(x,\\"mousedown\\",f)))},[f]),(0,m.useEffect)(()=>{x&&h&&(null!==z&&google.maps.event.removeListener(z),A(google.maps.event.addListener(x,\\"mousemove\\",h)))},[h]),(0,m.useEffect)(()=>{x&&d&&(null!==U&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(x,\\"mouseout\\",d)))},[d]),(0,m.useEffect)(()=>{x&&v&&(null!==V&&google.maps.event.removeListener(V),W(google.maps.event.addListener(x,\\"mouseover\\",v)))},[v]),(0,m.useEffect)(()=>{x&&y&&(null!==N&&google.maps.event.removeListener(N),H(google.maps.event.addListener(x,\\"mouseup\\",y)))},[y]),(0,m.useEffect)(()=>{x&&b&&(null!==G&&google.maps.event.removeListener(G),F(google.maps.event.addListener(x,\\"rightclick\\",b)))},[b]),(0,m.useEffect)(()=>{x&&a&&(null!==Y&&google.maps.event.removeListener(Y),K(google.maps.event.addListener(x,\\"click\\",a)))},[a]),(0,m.useEffect)(()=>{x&&u&&(null!==q&&google.maps.event.removeListener(q),J(google.maps.event.addListener(x,\\"drag\\",u)))},[u]),(0,m.useEffect)(()=>{x&&L&&(null!==O&&google.maps.event.removeListener(O),P(google.maps.event.addListener(x,\\"center_changed\\",L)))},[a]),(0,m.useEffect)(()=>{var e=null===k.current?null:new google.maps.Map(k.current,s);return M(e),null!==e&&w&&w(e),()=>{null!==e&&C&&C(e)}},[]),(0,g.jsx)(\\"div\\",{id:n,ref:k,style:o,className:i,children:(0,g.jsx)(E.Provider,{value:x,children:null!==x?t:null})})});class O extends m.PureComponent{constructor(){super(...arguments),y(this,\\"state\\",{map:null}),y(this,\\"registeredEvents\\",[]),y(this,\\"mapRef\\",null),y(this,\\"getInstance\\",()=>null===this.mapRef?null:new google.maps.Map(this.mapRef,this.props.options)),y(this,\\"panTo\\",e=>{var t=this.getInstance();t&&t.panTo(e)}),y(this,\\"setMapCallback\\",()=>{null!==this.state.map&&this.props.onLoad&&this.props.onLoad(this.state.map)}),y(this,\\"getRef\\",e=>{this.mapRef=e})}componentDidMount(){var e=this.getInstance();this.registeredEvents=x({updaterMap:k,eventMap:M,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{map:e}},this.setMapCallback)}componentDidUpdate(e){null!==this.state.map&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:k,eventMap:M,prevProps:e,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),C(this.registeredEvents))}render(){return(0,g.jsx)(\\"div\\",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:(0,g.jsx)(E.Provider,{value:this.state.map,children:null!==this.state.map?this.props.children:null})})}}function P(e,t,s,n,o,i,r){try{var a=e[i](r),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,o)}function S(e){return function(){var t=this,s=arguments;return new Promise(function(n,o){var i=e.apply(t,s);function r(e){P(i,n,o,r,a,\\"next\\",e)}function a(e){P(i,n,o,r,a,\\"throw\\",e)}r(void 0)})}}function j(e){var{googleMapsApiKey:t,googleMapsClientId:s,version:n=\\"weekly\\",language:o,region:i,libraries:r,channel:a,mapIds:l,authReferrerPolicy:u,apiUrl:p=\\"https://maps.googleapis.com\\"}=e,c=[];return L(t&&s||!(t&&s),\\"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time.\\"),t?c.push(\\"key=\\".concat(t)):s&&c.push(\\"client=\\".concat(s)),n&&c.push(\\"v=\\".concat(n)),o&&c.push(\\"language=\\".concat(o)),i&&c.push(\\"region=\\".concat(i)),r&&r.length&&c.push(\\"libraries=\\".concat(r.sort().join(\\",\\"))),a&&c.push(\\"channel=\\".concat(a)),l&&l.length&&c.push(\\"map_ids=\\".concat(l.join(\\",\\"))),u&&c.push(\\"auth_referrer_policy=\\".concat(u)),c.push(\\"loading=async\\"),c.push(\\"callback=initMap\\"),\\"\\".concat(p,\\"/maps/api/js?\\").concat(c.join(\\"&\\"))}var I=\\"undefined\\"!=typeof document;function D(e){var{url:t,id:s,nonce:n}=e;return I?new Promise(function(e,o){var i=document.getElementById(s),r=window;if(i){var a=i.getAttribute(\\"data-state\\");if(i.src===t&&\\"error\\"!==a)if(\\"ready\\"===a)return e(s);else{var l=r.initMap,u=i.onerror;r.initMap=function(){l&&l(),e(s)},i.onerror=function(e){u&&u(e),o(e)};return}i.remove()}var p=document.createElement(\\"script\\");p.type=\\"text/javascript\\",p.src=t,p.id=s,p.async=!0,p.nonce=n||\\"\\",p.onerror=function(e){p.setAttribute(\\"data-state\\",\\"error\\"),o(e)},r.initMap=function(){p.setAttribute(\\"data-state\\",\\"ready\\"),e(s)},document.head.appendChild(p)}).catch(e=>{throw console.error(\\"injectScript error: \\",e),e}):Promise.reject(Error(\\"document is undefined\\"))}function _(e){var t=e.href;return!!t&&(0===t.indexOf(\\"https://fonts.googleapis.com/css?family=Roboto\\")||0===t.indexOf(\\"https://fonts.googleapis.com/css?family=Google+Sans+Text\\"))||(\\"style\\"===e.tagName.toLowerCase()&&e.styleSheet&&e.styleSheet.cssText&&0===e.styleSheet.cssText.replace(\\"\\\\r\\\\n\\",\\"\\").indexOf(\\".gm-style\\")?(e.styleSheet.cssText=\\"\\",!0):\\"style\\"===e.tagName.toLowerCase()&&e.innerHTML&&0===e.innerHTML.replace(\\"\\\\r\\\\n\\",\\"\\").indexOf(\\".gm-style\\")?(e.innerHTML=\\"\\",!0):\\"style\\"===e.tagName.toLowerCase()&&!e.styleSheet&&!e.innerHTML)}function B(){var e=document.getElementsByTagName(\\"head\\")[0];if(e){var t=e.insertBefore.bind(e);e.insertBefore=function(s,n){return _(s)||Reflect.apply(t,e,[s,n]),s};var s=e.appendChild.bind(e);e.appendChild=function(t){return _(t)||Reflect.apply(s,e,[t]),t}}}var T=!1;function R(){return(0,g.jsx)(\\"div\\",{children:\\"Loading...\\"})}var z={id:\\"script-loader\\",version:\\"weekly\\"};class A extends m.PureComponent{constructor(){super(...arguments),y(this,\\"check\\",null),y(this,\\"state\\",{loaded:!1}),y(this,\\"cleanupCallback\\",()=>{delete window.google.maps,this.injectScript()}),y(this,\\"isCleaningUp\\",S(function*(){return new Promise(function(e){if(T){if(I)var t=window.setInterval(function(){T||(window.clearInterval(t),e())},1)}else e()})})),y(this,\\"cleanup\\",()=>{T=!0;var e=document.getElementById(this.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName(\\"script\\")).filter(function(e){return\\"string\\"==typeof e.src&&e.src.includes(\\"maps.googleapis\\")}).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),Array.prototype.slice.call(document.getElementsByTagName(\\"link\\")).filter(function(e){return\\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans\\"===e.href}).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),Array.prototype.slice.call(document.getElementsByTagName(\\"style\\")).filter(function(e){return void 0!==e.innerText&&e.innerText.length>0&&e.innerText.includes(\\".gm-\\")}).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}),y(this,\\"injectScript\\",()=>{this.props.preventGoogleFontsLoading&&B(),L(!!this.props.id,\'LoadScript requires \\"id\\" prop to be a string: %s\',this.props.id),D({id:this.props.id,nonce:this.props.nonce,url:j(this.props)}).then(()=>{this.props.onLoad&&this.props.onLoad(),this.setState(function(){return{loaded:!0}})}).catch(e=>{this.props.onError&&this.props.onError(e),console.error(\\"\\\\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (\\".concat(this.props.googleMapsApiKey||\\"-\\",\\") or Client ID (\\").concat(this.props.googleMapsClientId||\\"-\\",\\") to \\\\n Otherwise it is a Network issue.\\\\n \\"))})}),y(this,\\"getRef\\",e=>{this.check=e})}componentDidMount(){if(I){if(window.google&&window.google.maps&&!T)return void console.error(\\"google api is already presented\\");this.isCleaningUp().then(this.injectScript).catch(function(e){console.error(\\"Error at injecting script after cleaning up: \\",e)})}}componentDidUpdate(e){this.props.libraries!==e.libraries&&console.warn(\\"Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables\\"),I&&e.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))}componentWillUnmount(){if(I){this.cleanup();var e=()=>{this.check||(delete window.google,T=!1)};window.setTimeout(e,1),this.props.onUnmount&&this.props.onUnmount()}}render(){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(\\"div\\",{ref:this.getRef}),this.state.loaded?this.props.children:this.props.loadingElement||(0,g.jsx)(R,{})]})}}function U(e,t){if(null==e)return{};var s,n,o=function(e,t){if(null==e)return{};var s={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(t.includes(n))continue;s[n]=e[n]}return s}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{v.current=!1}},[]),(0,m.useEffect)(function(){I&&p&&B()},[p]),(0,m.useEffect)(function(){f&&L(!!window.google,\\"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.\\")},[f]);var w=j({version:s,googleMapsApiKey:o,googleMapsClientId:i,language:r,region:a,libraries:l,channel:c,mapIds:h,authReferrerPolicy:d,apiUrl:g});(0,m.useEffect)(function(){if(I){if(window.google&&window.google.maps&&u===w)return void e();D({id:t,url:w,nonce:n}).then(e).catch(function(e){v.current&&E(e),console.warn(\\"\\\\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (\\".concat(o||\\"-\\",\\") or Client ID (\\").concat(i||\\"-\\",\\")\\\\n Otherwise it is a Network issue.\\\\n \\")),console.error(e)})}function e(){v.current&&(y(!0),u=w)}},[t,w,n]);var C=(0,m.useRef)(void 0);return(0,m.useEffect)(function(){C.current&&l!==C.current&&console.warn(\\"Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables\\"),C.current=l},[l]),{isLoaded:f,loadError:b,url:w}}(U(e,Z));return(0,m.useEffect)(function(){r&&\\"function\\"==typeof s&&s()},[r,s]),(0,m.useEffect)(function(){a&&\\"function\\"==typeof n&&n(a)},[a,n]),(0,m.useEffect)(function(){return()=>{o&&o()}},[o]),r?i:t||V}),\\"function\\"==typeof SuppressedError&&SuppressedError;var W=(o=function e(t,s){if(t===s)return!0;if(t&&s&&\\"object\\"==typeof t&&\\"object\\"==typeof s){if(t.constructor!==s.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(o=n;0!=o--;)if(!e(t[o],s[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,i[o]))return!1;for(o=n;0!=o--;){var n,o,i,r=i[o];if(!e(t[r],s[r]))return!1}return!0}return t!=t&&s!=s}).__esModule&&Object.prototype.hasOwnProperty.call(o,\\"default\\")?o.default:o,N=\\"__googleMapsScriptId\\";(i=p||(p={}))[i.INITIALIZED=0]=\\"INITIALIZED\\",i[i.LOADING=1]=\\"LOADING\\",i[i.SUCCESS=2]=\\"SUCCESS\\",i[i.FAILURE=3]=\\"FAILURE\\";class H{constructor(e){var{apiKey:t,authReferrerPolicy:s,channel:n,client:o,id:i=N,language:r,libraries:a=[],mapIds:l,nonce:u,region:p,retries:c=3,url:h=\\"https://maps.googleapis.com/maps/api/js\\",version:d}=e;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=s,this.channel=n,this.client=o,this.id=i||N,this.language=r,this.libraries=a,this.mapIds=l,this.nonce=u,this.region=p,this.retries=c,this.url=h,this.version=d,H.instance){if(!W(this.options,H.instance.options))throw Error(\\"Loader must not be called again with different options. \\".concat(JSON.stringify(this.options),\\" !== \\").concat(JSON.stringify(H.instance.options)));return H.instance}H.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?p.FAILURE:this.done?p.SUCCESS:this.loading?p.LOADING:p.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){var e=this.url;return e+=\\"?callback=__googleMapsCallback&loading=async\\",this.apiKey&&(e+=\\"&key=\\".concat(this.apiKey)),this.channel&&(e+=\\"&channel=\\".concat(this.channel)),this.client&&(e+=\\"&client=\\".concat(this.client)),this.libraries.length>0&&(e+=\\"&libraries=\\".concat(this.libraries.join(\\",\\"))),this.language&&(e+=\\"&language=\\".concat(this.language)),this.region&&(e+=\\"®ion=\\".concat(this.region)),this.version&&(e+=\\"&v=\\".concat(this.version)),this.mapIds&&(e+=\\"&map_ids=\\".concat(this.mapIds.join(\\",\\"))),this.authReferrerPolicy&&(e+=\\"&auth_referrer_policy=\\".concat(this.authReferrerPolicy)),e}deleteScript(){var e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(s=>{s?t(s.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();var e,t,s,n,o,i,r,a,l,u,p,c,h,d={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(d).forEach(e=>!d[e]&&delete d[e]),(null==(h=null==(c=null==window?void 0:window.google)?void 0:c.maps)?void 0:h.importLibrary)||(n=\\"google\\",o=\\"importLibrary\\",i=document,a=(r=(r=window)[n]||(r[n]={})).maps||(r.maps={}),l=new Set,u=new URLSearchParams,p=()=>e||(e=new Promise((o,r)=>{var p,c,h;return p=this,c=void 0,h=function*(){var p;for(s in yield t=i.createElement(\\"script\\"),t.id=this.id,u.set(\\"libraries\\",[...l]+\\"\\"),d)u.set(s.replace(/[A-Z]/g,e=>\\"_\\"+e[0].toLowerCase()),d[s]);u.set(\\"callback\\",n+\\".maps.__ib__\\"),t.src=this.url+\\"?\\"+u,a.__ib__=o,t.onerror=()=>e=r(Error(\\"The Google Maps JavaScript API could not load.\\")),t.nonce=this.nonce||(null==(p=i.querySelector(\\"script[nonce]\\"))?void 0:p.nonce)||\\"\\",i.head.append(t)},new(c||(c=Promise))(function(e,t){function s(e){try{o(h.next(e))}catch(e){t(e)}}function n(e){try{o(h.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):((o=t.value)instanceof c?o:new c(function(e){e(o)})).then(s,n)}o((h=h.apply(p,[])).next())})})),a[o]?console.warn(\\"The Google Maps JavaScript API only loads once. Ignoring:\\",d):a[o]=function(e){for(var t=arguments.length,s=Array(t>1?t-1:0),n=1;na[o](e,...s))});var g=this.libraries.map(e=>this.importLibrary(e));g.length||g.push(this.importLibrary(\\"core\\")),Promise.all(g).then(()=>this.callback(),e=>{var t=new ErrorEvent(\\"error\\",{error:e});this.loadErrorCallback(t)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){var t=this.errors.length*Math.pow(2,this.errors.length);console.error(\\"Failed to load Google Maps script, retrying in \\".concat(t,\\" ms.\\")),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn(\\"Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match.\\"),this.callback();return}this.loading=!0,this.setScript()}}}var G=[\\"maps\\"];function F(e){var{id:t=z.id,version:s=z.version,nonce:n,googleMapsApiKey:o,language:i,region:r,libraries:a=G,preventGoogleFontsLoading:l,mapIds:u,authReferrerPolicy:p}=e,c=(0,m.useRef)(!1),[h,d]=(0,m.useState)(!1),[g,v]=(0,m.useState)(void 0);(0,m.useEffect)(function(){return c.current=!0,()=>{c.current=!1}},[]);var f=(0,m.useMemo)(()=>new H({id:t,apiKey:o,version:s,libraries:a,language:i||\\"en\\",region:r||\\"US\\",mapIds:u||[],nonce:n||\\"\\",authReferrerPolicy:p||\\"origin\\"}),[t,o,s,a,i,r,u,n,p]);(0,m.useEffect)(function(){h||f.load().then(()=>{c.current&&d(!0)}).catch(e=>{v(e)})},[]),(0,m.useEffect)(()=>{I&&l&&B()},[l]);var y=(0,m.useRef)();return(0,m.useEffect)(()=>{y.current&&a!==y.current&&console.warn(\\"Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables\\"),y.current=a},[a]),{isLoaded:h,loadError:g}}function Y(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function K(e){for(var t=1;t{null!==i&&i.setMap(o)},[o]),(0,m.useEffect)(()=>{t&&null!==i&&i.setOptions(t)},[i,t]),(0,m.useEffect)(()=>{var e=new google.maps.TrafficLayer(K(K({},t),{},{map:o}));return r(e),s&&s(e),()=>{null!==i&&(n&&n(i),i.setMap(null))}},[]),null});class X extends m.PureComponent{constructor(){super(...arguments),y(this,\\"state\\",{trafficLayer:null}),y(this,\\"setTrafficLayerCallback\\",()=>{null!==this.state.trafficLayer&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)}),y(this,\\"registeredEvents\\",[])}componentDidMount(){var e=new google.maps.TrafficLayer(K(K({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:J,eventMap:q,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{trafficLayer:e}},this.setTrafficLayerCallback)}componentDidUpdate(e){null!==this.state.trafficLayer&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:J,eventMap:q,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),C(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}y(X,\\"contextType\\",E),(0,m.memo)(function(e){var{onLoad:t,onUnmount:s}=e,n=(0,m.useContext)(E),[o,i]=(0,m.useState)(null);return(0,m.useEffect)(()=>{null!==o&&o.setMap(n)},[n]),(0,m.useEffect)(()=>{var e=new google.maps.BicyclingLayer;return i(e),e.setMap(n),t&&t(e),()=>{null!==e&&(s&&s(e),e.setMap(null))}},[]),null});class $ extends m.PureComponent{constructor(){super(...arguments),y(this,\\"state\\",{bicyclingLayer:null}),y(this,\\"setBicyclingLayerCallback\\",()=>{null!==this.state.bicyclingLayer&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))})}componentDidMount(){var e=new google.maps.BicyclingLayer;this.setState(()=>({bicyclingLayer:e}),this.setBicyclingLayerCallback)}componentWillUnmount(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}y($,\\"contextType\\",E),(0,m.memo)(function(e){var{onLoad:t,onUnmount:s}=e,n=(0,m.useContext)(E),[o,i]=(0,m.useState)(null);return(0,m.useEffect)(()=>{null!==o&&o.setMap(n)},[n]),(0,m.useEffect)(()=>{var e=new google.maps.TransitLayer;return i(e),e.setMap(n),t&&t(e),()=>{null!==o&&(s&&s(o),o.setMap(null))}},[]),null});class Q extends m.PureComponent{constructor(){super(...arguments),y(this,\\"state\\",{transitLayer:null}),y(this,\\"setTransitLayerCallback\\",()=>{null!==this.state.transitLayer&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))})}componentDidMount(){var e=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:e}},this.setTransitLayerCallback)}componentWillUnmount(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}function ee(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function et(e){for(var t=1;t{null!==h&&h.setMap(c)},[c]),(0,m.useEffect)(()=>{t&&null!==h&&h.setOptions(t)},[h,t]),(0,m.useEffect)(()=>{null!==h&&h.setDrawingMode(null!=s?s:null)},[h,s]),(0,m.useEffect)(()=>{h&&n&&(null!==g&&google.maps.event.removeListener(g),v(google.maps.event.addListener(h,\\"circlecomplete\\",n)))},[h,n]),(0,m.useEffect)(()=>{h&&o&&(null!==f&&google.maps.event.removeListener(f),y(google.maps.event.addListener(h,\\"markercomplete\\",o)))},[h,o]),(0,m.useEffect)(()=>{h&&i&&(null!==b&&google.maps.event.removeListener(b),w(google.maps.event.addListener(h,\\"overlaycomplete\\",i)))},[h,i]),(0,m.useEffect)(()=>{h&&r&&(null!==C&&google.maps.event.removeListener(C),x(google.maps.event.addListener(h,\\"polygoncomplete\\",r)))},[h,r]),(0,m.useEffect)(()=>{h&&a&&(null!==M&&google.maps.event.removeListener(M),k(google.maps.event.addListener(h,\\"polylinecomplete\\",a)))},[h,a]),(0,m.useEffect)(()=>{h&&l&&(null!==O&&google.maps.event.removeListener(O),P(google.maps.event.addListener(h,\\"rectanglecomplete\\",l)))},[h,l]),(0,m.useEffect)(()=>{L(!!google.maps.drawing,\\"Did you include prop libraries={[\'drawing\']} in the URL? %s\\",google.maps.drawing);var e=new google.maps.drawing.DrawingManager(et(et({},t),{},{map:c}));return s&&e.setDrawingMode(s),n&&v(google.maps.event.addListener(e,\\"circlecomplete\\",n)),o&&y(google.maps.event.addListener(e,\\"markercomplete\\",o)),i&&w(google.maps.event.addListener(e,\\"overlaycomplete\\",i)),r&&x(google.maps.event.addListener(e,\\"polygoncomplete\\",r)),a&&k(google.maps.event.addListener(e,\\"polylinecomplete\\",a)),l&&P(google.maps.event.addListener(e,\\"rectanglecomplete\\",l)),d(e),u&&u(e),()=>{null!==h&&(g&&google.maps.event.removeListener(g),f&&google.maps.event.removeListener(f),b&&google.maps.event.removeListener(b),C&&google.maps.event.removeListener(C),M&&google.maps.event.removeListener(M),O&&google.maps.event.removeListener(O),p&&p(h),h.setMap(null))}},[]),null});class eo extends m.PureComponent{constructor(e){super(e),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{drawingManager:null}),y(this,\\"setDrawingManagerCallback\\",()=>{null!==this.state.drawingManager&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)}),L(!!google.maps.drawing,\\"Did you include prop libraries={[\'drawing\']} in the URL? %s\\",google.maps.drawing)}componentDidMount(){var e=new google.maps.drawing.DrawingManager(et(et({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:en,eventMap:es,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{drawingManager:e}},this.setDrawingManagerCallback)}componentDidUpdate(e){null!==this.state.drawingManager&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:en,eventMap:es,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),C(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return null}}function ei(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function er(e){for(var t=1;t{null!==H&&H.setMap(N)},[N]),(0,m.useEffect)(()=>{void 0!==s&&null!==H&&H.setOptions(s)},[H,s]),(0,m.useEffect)(()=>{void 0!==r&&null!==H&&H.setDraggable(r)},[H,r]),(0,m.useEffect)(()=>{t&&null!==H&&H.setPosition(t)},[H,t]),(0,m.useEffect)(()=>{void 0!==a&&null!==H&&H.setVisible(a)},[H,a]),(0,m.useEffect)(()=>{null==H||H.setAnimation(l)},[H,l]),(0,m.useEffect)(()=>{H&&void 0!==u&&H.setClickable(u)},[H,u]),(0,m.useEffect)(()=>{H&&void 0!==p&&H.setCursor(p)},[H,p]),(0,m.useEffect)(()=>{H&&void 0!==c&&H.setIcon(c)},[H,c]),(0,m.useEffect)(()=>{H&&void 0!==h&&H.setLabel(h)},[H,h]),(0,m.useEffect)(()=>{H&&void 0!==d&&H.setOpacity(d)},[H,d]),(0,m.useEffect)(()=>{H&&void 0!==v&&H.setShape(v)},[H,v]),(0,m.useEffect)(()=>{H&&void 0!==f&&H.setTitle(f)},[H,f]),(0,m.useEffect)(()=>{H&&void 0!==y&&H.setZIndex(y)},[H,y]),(0,m.useEffect)(()=>{H&&L&&(null!==F&&google.maps.event.removeListener(F),Y(google.maps.event.addListener(H,\\"dblclick\\",L)))},[L]),(0,m.useEffect)(()=>{H&&C&&(null!==K&&google.maps.event.removeListener(K),q(google.maps.event.addListener(H,\\"dragend\\",C)))},[C]),(0,m.useEffect)(()=>{H&&x&&(null!==J&&google.maps.event.removeListener(J),X(google.maps.event.addListener(H,\\"dragstart\\",x)))},[x]),(0,m.useEffect)(()=>{H&&P&&(null!==$&&google.maps.event.removeListener($),Q(google.maps.event.addListener(H,\\"mousedown\\",P)))},[P]),(0,m.useEffect)(()=>{H&&M&&(null!==ee&&google.maps.event.removeListener(ee),et(google.maps.event.addListener(H,\\"mouseout\\",M)))},[M]),(0,m.useEffect)(()=>{H&&k&&(null!==es&&google.maps.event.removeListener(es),en(google.maps.event.addListener(H,\\"mouseover\\",k)))},[k]),(0,m.useEffect)(()=>{H&&O&&(null!==eo&&google.maps.event.removeListener(eo),ei(google.maps.event.addListener(H,\\"mouseup\\",O)))},[O]),(0,m.useEffect)(()=>{H&&S&&(null!==ea&&google.maps.event.removeListener(ea),el(google.maps.event.addListener(H,\\"rightclick\\",S)))},[S]),(0,m.useEffect)(()=>{H&&b&&(null!==ep&&google.maps.event.removeListener(ep),ec(google.maps.event.addListener(H,\\"click\\",b)))},[b]),(0,m.useEffect)(()=>{H&&w&&(null!==eh&&google.maps.event.removeListener(eh),ed(google.maps.event.addListener(H,\\"drag\\",w)))},[w]),(0,m.useEffect)(()=>{H&&j&&(null!==eg&&google.maps.event.removeListener(eg),em(google.maps.event.addListener(H,\\"clickable_changed\\",j)))},[j]),(0,m.useEffect)(()=>{H&&I&&(null!==ev&&google.maps.event.removeListener(ev),ef(google.maps.event.addListener(H,\\"cursor_changed\\",I)))},[I]),(0,m.useEffect)(()=>{H&&D&&(null!==ey&&google.maps.event.removeListener(ey),eb(google.maps.event.addListener(H,\\"animation_changed\\",D)))},[D]),(0,m.useEffect)(()=>{H&&_&&(null!==eL&&google.maps.event.removeListener(eL),eE(google.maps.event.addListener(H,\\"draggable_changed\\",_)))},[_]),(0,m.useEffect)(()=>{H&&B&&(null!==ew&&google.maps.event.removeListener(ew),eC(google.maps.event.addListener(H,\\"flat_changed\\",B)))},[B]),(0,m.useEffect)(()=>{H&&T&&(null!==ex&&google.maps.event.removeListener(ex),eM(google.maps.event.addListener(H,\\"icon_changed\\",T)))},[T]),(0,m.useEffect)(()=>{H&&R&&(null!==ek&&google.maps.event.removeListener(ek),eO(google.maps.event.addListener(H,\\"position_changed\\",R)))},[R]),(0,m.useEffect)(()=>{H&&z&&(null!==eP&&google.maps.event.removeListener(eP),eS(google.maps.event.addListener(H,\\"shape_changed\\",z)))},[z]),(0,m.useEffect)(()=>{H&&A&&(null!==ej&&google.maps.event.removeListener(ej),eI(google.maps.event.addListener(H,\\"title_changed\\",A)))},[A]),(0,m.useEffect)(()=>{H&&U&&(null!==eD&&google.maps.event.removeListener(eD),e_(google.maps.event.addListener(H,\\"visible_changed\\",U)))},[U]),(0,m.useEffect)(()=>{H&&Z&&(null!==eB&&google.maps.event.removeListener(eB),eT(google.maps.event.addListener(H,\\"zindex_changed\\",Z)))},[Z]),(0,m.useEffect)(()=>{var e=er(er(er({},s||eu),n?eu:{map:N}),{},{position:t}),i=new google.maps.Marker(e);return n?n.addMarker(i,!!o):i.setMap(N),t&&i.setPosition(t),void 0!==a&&i.setVisible(a),void 0!==r&&i.setDraggable(r),void 0!==u&&i.setClickable(u),\\"string\\"==typeof p&&i.setCursor(p),c&&i.setIcon(c),void 0!==h&&i.setLabel(h),void 0!==d&&i.setOpacity(d),v&&i.setShape(v),\\"string\\"==typeof f&&i.setTitle(f),\\"number\\"==typeof y&&i.setZIndex(y),L&&Y(google.maps.event.addListener(i,\\"dblclick\\",L)),C&&q(google.maps.event.addListener(i,\\"dragend\\",C)),x&&X(google.maps.event.addListener(i,\\"dragstart\\",x)),P&&Q(google.maps.event.addListener(i,\\"mousedown\\",P)),M&&et(google.maps.event.addListener(i,\\"mouseout\\",M)),k&&en(google.maps.event.addListener(i,\\"mouseover\\",k)),O&&ei(google.maps.event.addListener(i,\\"mouseup\\",O)),S&&el(google.maps.event.addListener(i,\\"rightclick\\",S)),b&&ec(google.maps.event.addListener(i,\\"click\\",b)),w&&ed(google.maps.event.addListener(i,\\"drag\\",w)),j&&em(google.maps.event.addListener(i,\\"clickable_changed\\",j)),I&&ef(google.maps.event.addListener(i,\\"cursor_changed\\",I)),D&&eb(google.maps.event.addListener(i,\\"animation_changed\\",D)),_&&eE(google.maps.event.addListener(i,\\"draggable_changed\\",_)),B&&eC(google.maps.event.addListener(i,\\"flat_changed\\",B)),T&&eM(google.maps.event.addListener(i,\\"icon_changed\\",T)),R&&eO(google.maps.event.addListener(i,\\"position_changed\\",R)),z&&eS(google.maps.event.addListener(i,\\"shape_changed\\",z)),A&&eI(google.maps.event.addListener(i,\\"title_changed\\",A)),U&&e_(google.maps.event.addListener(i,\\"visible_changed\\",U)),Z&&eT(google.maps.event.addListener(i,\\"zindex_changed\\",Z)),G(i),V&&V(i),()=>{null!==F&&google.maps.event.removeListener(F),null!==K&&google.maps.event.removeListener(K),null!==J&&google.maps.event.removeListener(J),null!==$&&google.maps.event.removeListener($),null!==ee&&google.maps.event.removeListener(ee),null!==es&&google.maps.event.removeListener(es),null!==eo&&google.maps.event.removeListener(eo),null!==ea&&google.maps.event.removeListener(ea),null!==ep&&google.maps.event.removeListener(ep),null!==eg&&google.maps.event.removeListener(eg),null!==ev&&google.maps.event.removeListener(ev),null!==ey&&google.maps.event.removeListener(ey),null!==eL&&google.maps.event.removeListener(eL),null!==ew&&google.maps.event.removeListener(ew),null!==ex&&google.maps.event.removeListener(ex),null!==ek&&google.maps.event.removeListener(ek),null!==ej&&google.maps.event.removeListener(ej),null!==eD&&google.maps.event.removeListener(eD),null!==eB&&google.maps.event.removeListener(eB),W&&W(i),n?n.removeMarker(i,!!o):i&&i.setMap(null)}},[]);var eR=(0,m.useMemo)(()=>i?m.Children.map(i,e=>(0,m.isValidElement)(e)?(0,m.cloneElement)(e,{anchor:H}):e):null,[i,H]);return(0,g.jsx)(g.Fragment,{children:eR})||null});class ep extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[])}componentDidMount(){var e=this;return S(function*(){var t=er(er(er({},e.props.options||eu),e.props.clusterer?eu:{map:e.context}),{},{position:e.props.position});e.marker=new google.maps.Marker(t),e.props.clusterer?e.props.clusterer.addMarker(e.marker,!!e.props.noClustererRedraw):e.marker.setMap(e.context),e.registeredEvents=x({updaterMap:el,eventMap:ea,prevProps:{},nextProps:e.props,instance:e.marker}),e.props.onLoad&&e.props.onLoad(e.marker)})()}componentDidUpdate(e){this.marker&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:el,eventMap:ea,prevProps:e,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),C(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){return(this.props.children?m.Children.map(this.props.children,e=>(0,m.isValidElement)(e)?(0,m.cloneElement)(e,{anchor:this.marker}):e):null)||null}}y(ep,\\"contextType\\",E);var ec=function(){function e(t,s){t.getClusterer().extend(e,google.maps.OverlayView),this.cluster=t,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=s,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url=\\"\\",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor=\\"black\\",this.textSize=11,this.textDecoration=\\"none\\",this.fontWeight=\\"bold\\",this.fontStyle=\\"normal\\",this.fontFamily=\\"Arial,sans-serif\\",this.backgroundPosition=\\"0 0\\",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(t.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return e.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},e.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},e.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var t=this.cluster.getClusterer();if(google.maps.event.trigger(t,\\"click\\",this.cluster),google.maps.event.trigger(t,\\"clusterclick\\",this.cluster),t.getZoomOnClick()){var s=t.getMaxZoom(),n=this.cluster.getBounds(),o=t.getMap();null!==o&&\\"fitBounds\\"in o&&o.fitBounds(n),this.timeOut=window.setTimeout(function(){var e=t.getMap();if(null!==e){\\"fitBounds\\"in e&&e.fitBounds(n);var o=e.getZoom()||0;null!==s&&o>s&&e.setZoom(s+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},e.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),\\"mouseover\\",this.cluster)},e.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),\\"mouseout\\",this.cluster)},e.prototype.onAdd=function(){this.div=document.createElement(\\"div\\"),this.div.className=this.className,this.visible&&this.show(),null==(e=this.getPanes())||e.overlayMouseTarget.appendChild(this.div);var e,t=this.getMap();null!==t&&(this.boundsChangedListener=google.maps.event.addListener(t,\\"bounds_changed\\",this.onBoundsChanged),this.div.addEventListener(\\"mousedown\\",this.onMouseDown),this.div.addEventListener(\\"click\\",this.onClick),this.div.addEventListener(\\"mouseover\\",this.onMouseOver),this.div.addEventListener(\\"mouseout\\",this.onMouseOut))},e.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),null!==this.boundsChangedListener&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener(\\"mousedown\\",this.onMouseDown),this.div.removeEventListener(\\"click\\",this.onClick),this.div.removeEventListener(\\"mouseover\\",this.onMouseOver),this.div.removeEventListener(\\"mouseout\\",this.onMouseOut),this.div.parentNode.removeChild(this.div),null!==this.timeOut&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},e.prototype.draw=function(){if(this.visible&&null!==this.div&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=null!==e?\\"\\".concat(e.y,\\"px\\"):\\"0\\",this.div.style.left=null!==e?\\"\\".concat(e.x,\\"px\\"):\\"0\\"}},e.prototype.hide=function(){this.div&&(this.div.style.display=\\"none\\"),this.visible=!1},e.prototype.show=function(){var e,t,s,n,o,i;if(this.div&&this.center){var r=null===this.sums||void 0===this.sums.title||\\"\\"===this.sums.title?this.cluster.getClusterer().getTitle():this.sums.title,a=this.backgroundPosition.split(\\" \\"),l=parseInt((null==(e=a[0])?void 0:e.replace(/^\\\\s+|\\\\s+$/g,\\"\\"))||\\"0\\",10),u=parseInt((null==(t=a[1])?void 0:t.replace(/^\\\\s+|\\\\s+$/g,\\"\\"))||\\"0\\",10),p=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute(\\"style\\",\\"cursor: pointer; position: absolute; top: \\".concat(null!==p?\\"\\".concat(p.y,\\"px\\"):\\"0\\",\\"; left: \\").concat(null!==p?\\"\\".concat(p.x,\\"px\\"):\\"0\\",\\"; width: \\").concat(this.width,\\"px; height: \\").concat(this.height,\\"px; \\"));var c=document.createElement(\\"img\\");c.alt=r,c.src=this.url,c.width=this.width,c.height=this.height,c.setAttribute(\\"style\\",\\"position: absolute; top: \\".concat(u,\\"px; left: \\").concat(l,\\"px\\")),this.cluster.getClusterer().enableRetinaIcons||(c.style.clip=\\"rect(-\\".concat(u,\\"px, -\\").concat(l+this.width,\\"px, -\\").concat(u+this.height,\\", -\\").concat(l,\\")\\"));var h=document.createElement(\\"div\\");h.setAttribute(\\"style\\",\\"position: absolute; top: \\".concat(this.anchorText[0],\\"px; left: \\").concat(this.anchorText[1],\\"px; color: \\").concat(this.textColor,\\"; font-size: \\").concat(this.textSize,\\"px; font-family: \\").concat(this.fontFamily,\\"; font-weight: \\").concat(this.fontWeight,\\"; fontStyle: \\").concat(this.fontStyle,\\"; text-decoration: \\").concat(this.textDecoration,\\"; text-align: center; width: \\").concat(this.width,\\"px; line-height: \\").concat(this.height,\\"px\\")),(null==(s=this.sums)?void 0:s.text)&&(h.innerText=\\"\\".concat(null==(n=this.sums)?void 0:n.text)),(null==(o=this.sums)?void 0:o.html)&&(h.innerHTML=\\"\\".concat(null==(i=this.sums)?void 0:i.html)),this.div.innerHTML=\\"\\",this.div.appendChild(c),this.div.appendChild(h),this.div.title=r,this.div.style.display=\\"\\"}this.visible=!0},e.prototype.useStyle=function(e){this.sums=e;var t=this.cluster.getClusterer().getStyles(),s=t[Math.min(t.length-1,Math.max(0,e.index-1))];s&&(this.url=s.url,this.height=s.height,this.width=s.width,s.className&&(this.className=\\"\\".concat(this.clusterClassName,\\" \\").concat(s.className)),this.anchorText=s.anchorText||[0,0],this.anchorIcon=s.anchorIcon||[this.height/2,this.width/2],this.textColor=s.textColor||\\"black\\",this.textSize=s.textSize||11,this.textDecoration=s.textDecoration||\\"none\\",this.fontWeight=s.fontWeight||\\"bold\\",this.fontStyle=s.fontStyle||\\"normal\\",this.fontFamily=s.fontFamily||\\"Arial,sans-serif\\",this.backgroundPosition=s.backgroundPosition||\\"0 0\\")},e.prototype.setCenter=function(e){this.center=e},e.prototype.getPosFromLatLng=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return null!==t&&(t.x-=this.anchorIcon[1],t.y-=this.anchorIcon[0]),t},e}(),eh=function(){function e(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new ec(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return e.prototype.getSize=function(){return this.markers.length},e.prototype.getMarkers=function(){return this.markers},e.prototype.getCenter=function(){return this.center},e.prototype.getMap=function(){return this.map},e.prototype.getClusterer=function(){return this.markerClusterer},e.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),t=this.getMarkers(),s=0;si)e.getMap()!==this.map&&e.setMap(this.map);else if(os||t0))for(var e=0;e3?new google.maps.LatLngBounds(null==n?void 0:n.getSouthWest(),null==n?void 0:n.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),i=this.getExtendedBounds(o),r=Math.min(e+this.batchSize,this.markers.length),a=e;a{P&&M&&(null!==z&&google.maps.event.removeListener(z),A(google.maps.event.addListener(P,ef.onMouseOut,M)))},[M]),(0,m.useEffect)(()=>{P&&x&&(null!==U&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(P,ef.onMouseOver,x)))},[x]),(0,m.useEffect)(()=>{P&&L&&(null!==I&&google.maps.event.removeListener(I),D(google.maps.event.addListener(P,ef.onClick,L)))},[L]),(0,m.useEffect)(()=>{P&&w&&(null!==_&&google.maps.event.removeListener(_),B(google.maps.event.addListener(P,ef.onClusteringBegin,w)))},[w]),(0,m.useEffect)(()=>{P&&C&&(null!==T&&google.maps.event.removeListener(T),B(google.maps.event.addListener(P,ef.onClusteringEnd,C)))},[C]),(0,m.useEffect)(()=>{void 0!==n&&null!==P&&ey.averageCenter(P,n)},[P,n]),(0,m.useEffect)(()=>{void 0!==o&&null!==P&&ey.batchSizeIE(P,o)},[P,o]),(0,m.useEffect)(()=>{void 0!==i&&null!==P&&ey.calculator(P,i)},[P,i]),(0,m.useEffect)(()=>{void 0!==r&&null!==P&&ey.clusterClass(P,r)},[P,r]),(0,m.useEffect)(()=>{void 0!==a&&null!==P&&ey.enableRetinaIcons(P,a)},[P,a]),(0,m.useEffect)(()=>{void 0!==l&&null!==P&&ey.gridSize(P,l)},[P,l]),(0,m.useEffect)(()=>{void 0!==u&&null!==P&&ey.ignoreHidden(P,u)},[P,u]),(0,m.useEffect)(()=>{void 0!==p&&null!==P&&ey.imageExtension(P,p)},[P,p]),(0,m.useEffect)(()=>{void 0!==c&&null!==P&&ey.imagePath(P,c)},[P,c]),(0,m.useEffect)(()=>{void 0!==h&&null!==P&&ey.imageSizes(P,h)},[P,h]),(0,m.useEffect)(()=>{void 0!==d&&null!==P&&ey.maxZoom(P,d)},[P,d]),(0,m.useEffect)(()=>{void 0!==g&&null!==P&&ey.minimumClusterSize(P,g)},[P,g]),(0,m.useEffect)(()=>{void 0!==v&&null!==P&&ey.styles(P,v)},[P,v]),(0,m.useEffect)(()=>{void 0!==f&&null!==P&&ey.title(P,f)},[P,f]),(0,m.useEffect)(()=>{void 0!==b&&null!==P&&ey.zoomOnClick(P,b)},[P,b]),(0,m.useEffect)(()=>{if(j){var e=new em(j,[],function(e){for(var t=1;t{null!==z&&google.maps.event.removeListener(z),null!==U&&google.maps.event.removeListener(U),null!==I&&google.maps.event.removeListener(I),null!==_&&google.maps.event.removeListener(_),null!==T&&google.maps.event.removeListener(T),O&&O(e)}}},[]),null!==P&&t(P)||null});class eL extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{markerClusterer:null}),y(this,\\"setClustererCallback\\",()=>{null!==this.state.markerClusterer&&this.props.onLoad&&this.props.onLoad(this.state.markerClusterer)})}componentDidMount(){if(this.context){var e=new em(this.context,[],this.props.options);this.registeredEvents=x({updaterMap:ey,eventMap:ef,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({markerClusterer:e}),this.setClustererCallback)}}componentDidUpdate(e){this.state.markerClusterer&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:ey,eventMap:ef,prevProps:e,nextProps:this.props,instance:this.state.markerClusterer}))}componentWillUnmount(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),C(this.registeredEvents),this.state.markerClusterer.setMap(null))}render(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null}}function eE(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}y(eL,\\"contextType\\",E);var ew=function(){function e(t){void 0===t&&(t={}),this.getCloseClickHandler=this.getCloseClickHandler.bind(this),this.closeClickHandler=this.closeClickHandler.bind(this),this.createInfoBoxDiv=this.createInfoBoxDiv.bind(this),this.addClickHandler=this.addClickHandler.bind(this),this.getCloseBoxImg=this.getCloseBoxImg.bind(this),this.getBoxWidths=this.getBoxWidths.bind(this),this.setBoxStyle=this.setBoxStyle.bind(this),this.setPosition=this.setPosition.bind(this),this.getPosition=this.getPosition.bind(this),this.setOptions=this.setOptions.bind(this),this.setContent=this.setContent.bind(this),this.setVisible=this.setVisible.bind(this),this.getContent=this.getContent.bind(this),this.getVisible=this.getVisible.bind(this),this.setZIndex=this.setZIndex.bind(this),this.getZIndex=this.getZIndex.bind(this),this.onRemove=this.onRemove.bind(this),this.panBox=this.panBox.bind(this),this.extend=this.extend.bind(this),this.close=this.close.bind(this),this.draw=this.draw.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.open=this.open.bind(this),this.extend(e,google.maps.OverlayView),this.content=t.content||\\"\\",this.disableAutoPan=t.disableAutoPan||!1,this.maxWidth=t.maxWidth||0,this.pixelOffset=t.pixelOffset||new google.maps.Size(0,0),this.position=t.position||new google.maps.LatLng(0,0),this.zIndex=t.zIndex||null,this.boxClass=t.boxClass||\\"infoBox\\",this.boxStyle=t.boxStyle||{},this.closeBoxMargin=t.closeBoxMargin||\\"2px\\",this.closeBoxURL=t.closeBoxURL||\\"http://www.google.com/intl/en_us/mapfiles/close.gif\\",\\"\\"===t.closeBoxURL&&(this.closeBoxURL=\\"\\"),this.infoBoxClearance=t.infoBoxClearance||new google.maps.Size(1,1),void 0===t.visible&&(void 0===t.isHidden?t.visible=!0:t.visible=!t.isHidden),this.isHidden=!t.visible,this.alignBottom=t.alignBottom||!1,this.pane=t.pane||\\"floatPane\\",this.enableEventPropagation=t.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return e.prototype.createInfoBoxDiv=function(){var e=this;if(!this.div){this.div=document.createElement(\\"div\\"),this.setBoxStyle(),\\"string\\"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var t=this.getPanes();if(null!==t&&t[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+\\"px\\",this.fixedWidthSet=!0;else{var s=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-s.left-s.right+\\"px\\",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var n=0,o=[\\"mousedown\\",\\"mouseover\\",\\"mouseout\\",\\"mouseup\\",\\"click\\",\\"dblclick\\",\\"touchstart\\",\\"touchend\\",\\"touchmove\\"];n\\"),e},e.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&\\"\\"!==this.closeBoxURL?google.maps.event.addListener(this.div.firstChild,\\"click\\",this.getCloseClickHandler()):null},e.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,\\"closeclick\\"),this.close()},e.prototype.getCloseClickHandler=function(){return this.closeClickHandler},e.prototype.panBox=function(e){if(this.div&&!e){var t=this.getMap();if(t instanceof google.maps.Map){var s=0,n=0,o=t.getBounds();o&&!o.contains(this.position)&&t.setCenter(this.position);var i=t.getDiv(),r=i.offsetWidth,a=i.offsetHeight,l=this.pixelOffset.width,u=this.pixelOffset.height,p=this.div.offsetWidth,c=this.div.offsetHeight,h=this.infoBoxClearance.width,d=this.infoBoxClearance.height,g=this.getProjection().fromLatLngToContainerPixel(this.position);null!==g&&(g.x<-l+h?s=g.x+l-h:g.x+p+l+h>r&&(s=g.x+p+l+h-r),this.alignBottom?g.y<-u+d+c?n=g.y+u-d-c:g.y+u+d>a&&(n=g.y+u+d-a):g.y<-u+d?n=g.y+u-d:g.y+c+u+d>a&&(n=g.y+c+u+d-a)),(0!==s||0!==n)&&t.panBy(s,n)}}},e.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText=\\"\\";var e=this.boxStyle;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.div.style[t]=e[t]);if(this.div.style.webkitTransform=\\"translateZ(0)\\",void 0!==this.div.style.opacity&&\\"\\"!==this.div.style.opacity){var s=parseFloat(this.div.style.opacity||\\"\\");this.div.style.msFilter=\'\\"progid:DXImageTransform.Microsoft.Alpha(Opacity=\'+100*s+\')\\"\',this.div.style.filter=\\"alpha(opacity=\\"+100*s+\\")\\"}this.div.style.position=\\"absolute\\",this.div.style.visibility=\\"hidden\\",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+\\"\\"),this.div.style.overflow||(this.div.style.overflow=\\"auto\\")}},e.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var t=this.div.ownerDocument,s=t&&t.defaultView?t.defaultView.getComputedStyle(this.div,\\"\\"):null;s&&(e.top=parseInt(s.borderTopWidth||\\"\\",10)||0,e.bottom=parseInt(s.borderBottomWidth||\\"\\",10)||0,e.left=parseInt(s.borderLeftWidth||\\"\\",10)||0,e.right=parseInt(s.borderRightWidth||\\"\\",10)||0)}else if(document.documentElement.currentStyle){var n=this.div.currentStyle;n&&(e.top=parseInt(n.borderTopWidth||\\"\\",10)||0,e.bottom=parseInt(n.borderBottomWidth||\\"\\",10)||0,e.left=parseInt(n.borderLeftWidth||\\"\\",10)||0,e.right=parseInt(n.borderRightWidth||\\"\\",10)||0)}return e},e.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},e.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection().fromLatLngToDivPixel(this.position);null!==e&&(this.div.style.left=e.x+this.pixelOffset.width+\\"px\\",this.alignBottom?this.div.style.bottom=-(e.y+this.pixelOffset.height)+\\"px\\":this.div.style.top=e.y+this.pixelOffset.height+\\"px\\"),this.isHidden?this.div.style.visibility=\\"hidden\\":this.div.style.visibility=\\"visible\\"}},e.prototype.setOptions=function(e){void 0===e&&(e={}),void 0!==e.boxClass&&(this.boxClass=e.boxClass,this.setBoxStyle()),void 0!==e.boxStyle&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),void 0!==e.content&&this.setContent(e.content),void 0!==e.disableAutoPan&&(this.disableAutoPan=e.disableAutoPan),void 0!==e.maxWidth&&(this.maxWidth=e.maxWidth),void 0!==e.pixelOffset&&(this.pixelOffset=e.pixelOffset),void 0!==e.alignBottom&&(this.alignBottom=e.alignBottom),void 0!==e.position&&this.setPosition(e.position),void 0!==e.zIndex&&this.setZIndex(e.zIndex),void 0!==e.closeBoxMargin&&(this.closeBoxMargin=e.closeBoxMargin),void 0!==e.closeBoxURL&&(this.closeBoxURL=e.closeBoxURL),void 0!==e.infoBoxClearance&&(this.infoBoxClearance=e.infoBoxClearance),void 0!==e.isHidden&&(this.isHidden=e.isHidden),void 0!==e.visible&&(this.isHidden=!e.visible),void 0!==e.enableEventPropagation&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},e.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=\\"\\"),\\"string\\"==typeof e?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+\\"px\\",\\"string\\"==typeof e?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,\\"content_changed\\")},e.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,\\"position_changed\\")},e.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?\\"hidden\\":\\"visible\\")},e.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+\\"\\"),google.maps.event.trigger(this,\\"zindex_changed\\")},e.prototype.getContent=function(){return this.content},e.prototype.getPosition=function(){return this.position},e.prototype.getZIndex=function(){return this.zIndex},e.prototype.getVisible=function(){return null!=this.getMap()&&!this.isHidden},e.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility=\\"visible\\")},e.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility=\\"hidden\\")},e.prototype.open=function(e,t){var s=this;t&&(this.position=t.getPosition(),this.moveListener=google.maps.event.addListener(t,\\"position_changed\\",function(){var e=t.getPosition();s.setPosition(e)}),this.mapListener=google.maps.event.addListener(t,\\"map_changed\\",function(){s.setMap(t.map)})),this.setMap(e),this.div&&this.panBox()},e.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,t=this.eventListeners;e{d&&null!==g&&(g.close(),s?g.open(d,s):g.getPosition()&&g.open(d))},[d,g,s]),(0,m.useEffect)(()=>{n&&null!==g&&g.setOptions(n)},[g,n]),(0,m.useEffect)(()=>{if(o&&null!==g){var e=o instanceof google.maps.LatLng?o:new google.maps.LatLng(o.lat,o.lng);g.setPosition(e)}},[o]),(0,m.useEffect)(()=>{\\"number\\"==typeof i&&null!==g&&g.setZIndex(i)},[i]),(0,m.useEffect)(()=>{g&&r&&(null!==y&&google.maps.event.removeListener(y),b(google.maps.event.addListener(g,\\"closeclick\\",r)))},[r]),(0,m.useEffect)(()=>{g&&a&&(null!==w&&google.maps.event.removeListener(w),C(google.maps.event.addListener(g,\\"domready\\",a)))},[a]),(0,m.useEffect)(()=>{g&&l&&(null!==x&&google.maps.event.removeListener(x),M(google.maps.event.addListener(g,\\"content_changed\\",l)))},[l]),(0,m.useEffect)(()=>{g&&u&&(null!==k&&google.maps.event.removeListener(k),O(google.maps.event.addListener(g,\\"position_changed\\",u)))},[u]),(0,m.useEffect)(()=>{g&&p&&(null!==P&&google.maps.event.removeListener(P),S(google.maps.event.addListener(g,\\"zindex_changed\\",p)))},[p]),(0,m.useEffect)(()=>{if(d){var e,t=n||eS,{position:o}=t,i=U(t,eC);!o||o instanceof google.maps.LatLng||(e=new google.maps.LatLng(o.lat,o.lng));var m=new ew(ek(ek({},i),e?{position:e}:{}));j.current=document.createElement(\\"div\\"),f(m),r&&b(google.maps.event.addListener(m,\\"closeclick\\",r)),a&&C(google.maps.event.addListener(m,\\"domready\\",a)),l&&M(google.maps.event.addListener(m,\\"content_changed\\",l)),u&&O(google.maps.event.addListener(m,\\"position_changed\\",u)),p&&S(google.maps.event.addListener(m,\\"zindex_changed\\",p)),m.setContent(j.current),s?m.open(d,s):m.getPosition()?m.open(d):L(!1,\\"You must provide either an anchor or a position prop for .\\"),c&&c(m)}return()=>{null!==g&&(y&&google.maps.event.removeListener(y),x&&google.maps.event.removeListener(x),w&&google.maps.event.removeListener(w),k&&google.maps.event.removeListener(k),P&&google.maps.event.removeListener(P),h&&h(g),g.close())}},[]),j.current?(0,v.createPortal)(m.Children.only(t),j.current):null});class ej extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"containerElement\\",null),y(this,\\"state\\",{infoBox:null}),y(this,\\"open\\",(e,t)=>{t?null!==this.context&&e.open(this.context,t):e.getPosition()?null!==this.context&&e.open(this.context):L(!1,\\"You must provide either an anchor or a position prop for .\\")}),y(this,\\"setInfoBoxCallback\\",()=>{null!==this.state.infoBox&&null!==this.containerElement&&(this.state.infoBox.setContent(this.containerElement),this.open(this.state.infoBox,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoBox))})}componentDidMount(){var e,t=this.props.options||{},{position:s}=t,n=U(t,ex);!s||s instanceof google.maps.LatLng||(e=new google.maps.LatLng(s.lat,s.lng));var o=new ew(ek(ek({},n),e?{position:e}:{}));this.containerElement=document.createElement(\\"div\\"),this.registeredEvents=x({updaterMap:eP,eventMap:eO,prevProps:{},nextProps:this.props,instance:o}),this.setState({infoBox:o},this.setInfoBoxCallback)}componentDidUpdate(e){var{infoBox:t}=this.state;null!==t&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:eP,eventMap:eO,prevProps:e,nextProps:this.props,instance:t}))}componentWillUnmount(){var{onUnmount:e}=this.props,{infoBox:t}=this.state;null!==t&&(e&&e(t),C(this.registeredEvents),t.close())}render(){return this.containerElement?(0,v.createPortal)(m.Children.only(this.props.children),this.containerElement):null}}y(ej,\\"contextType\\",E);var eI=b(h?c:(h=1,c=function e(t,s){if(t===s)return!0;if(t&&s&&\\"object\\"==typeof t&&\\"object\\"==typeof s){if(t.constructor!==s.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(o=n;0!=o--;)if(!e(t[o],s[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,i[o]))return!1;for(o=n;0!=o--;){var n,o,i,r=i[o];if(!e(t[r],s[r]))return!1}return!0}return t!=t&&s!=s})),eD=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class e_{static from(e){if(!(e instanceof ArrayBuffer))throw Error(\\"Data must be an instance of ArrayBuffer.\\");var[t,s]=new Uint8Array(e,0,2);if(219!==t)throw Error(\\"Data does not appear to be in a KDBush format.\\");var n=s>>4;if(1!==n)throw Error(\\"Got v\\".concat(n,\\" data when expected v\\").concat(1,\\".\\"));var o=eD[15&s];if(!o)throw Error(\\"Unrecognized array type.\\");var[i]=new Uint16Array(e,2,1),[r]=new Uint32Array(e,4,1);return new e_(r,i,o,e)}constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,n=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw Error(\\"Unpexpected numItems value: \\".concat(e,\\".\\"));this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;var o=eD.indexOf(this.ArrayType),i=2*e*this.ArrayType.BYTES_PER_ELEMENT,r=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-r%8)%8;if(o<0)throw Error(\\"Unexpected typed array class: \\".concat(s,\\".\\"));n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+r+a,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+i+r+a),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+r+a,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){var s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=t,s}finish(){var e=this._pos>>1;if(e!==this.numItems)throw Error(\\"Added \\".concat(e,\\" items when expected \\").concat(this.numItems,\\".\\"));return function e(t,s,n,o,i,r){if(!(i-o<=n)){var a=o+i>>1;(function e(t,s,n,o,i,r){for(;i>o;){if(i-o>600){var a=i-o+1,l=n-o+1,u=Math.log(a),p=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*p*(a-p)/a)*(l-a/2<0?-1:1),h=Math.max(o,Math.floor(n-l*p/a+c)),d=Math.min(i,Math.floor(n+(a-l)*p/a+c));e(t,s,n,h,d,r)}var g=s[2*n+r],m=o,v=i;for(eB(t,s,o,n),s[2*i+r]>g&&eB(t,s,o,i);mg;)v--}s[2*o+r]===g?eB(t,s,o,v):eB(t,s,++v,i),v<=n&&(o=v+1),n<=v&&(i=v-1)}})(t,s,a,o,i,r),e(t,s,n,o,a-1,1-r),e(t,s,n,a+1,i,1-r)}}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,s,n){if(!this._finished)throw Error(\\"Data not yet indexed - call index.finish().\\");for(var{ids:o,coords:i,nodeSize:r}=this,a=[0,o.length-1,0],l=[];a.length;){var u=a.pop()||0,p=a.pop()||0,c=a.pop()||0;if(p-c<=r){for(var h=c;h<=p;h++){var d=i[2*h],g=i[2*h+1];d>=e&&d<=s&&g>=t&&g<=n&&l.push(o[h])}continue}var m=c+p>>1,v=i[2*m],f=i[2*m+1];v>=e&&v<=s&&f>=t&&f<=n&&l.push(o[m]),(0===u?e<=v:t<=f)&&(a.push(c),a.push(m-1),a.push(1-u)),(0===u?s>=v:n>=f)&&(a.push(m+1),a.push(p),a.push(1-u))}return l}within(e,t,s){if(!this._finished)throw Error(\\"Data not yet indexed - call index.finish().\\");for(var{ids:n,coords:o,nodeSize:i}=this,r=[0,n.length-1,0],a=[],l=s*s;r.length;){var u=r.pop()||0,p=r.pop()||0,c=r.pop()||0;if(p-c<=i){for(var h=c;h<=p;h++)eR(o[2*h],o[2*h+1],e,t)<=l&&a.push(n[h]);continue}var d=c+p>>1,g=o[2*d],m=o[2*d+1];eR(g,m,e,t)<=l&&a.push(n[d]),(0===u?e-s<=g:t-s<=m)&&(r.push(c),r.push(d-1),r.push(1-u)),(0===u?e+s>=g:t+s>=m)&&(r.push(d+1),r.push(p),r.push(1-u))}return a}}function eB(e,t,s,n){eT(e,s,n),eT(t,2*s,2*n),eT(t,2*s+1,2*n+1)}function eT(e,t,s){var n=e[t];e[t]=e[s],e[s]=n}function eR(e,t,s,n){var o=e-s,i=t-n;return o*o+i*i}var ez={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},eA=Math.fround||(n=new Float32Array(1),e=>(n[0]=+e,n[0]));class eU{constructor(e){this.options=Object.assign(Object.create(ez),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){var{log:t,minZoom:s,maxZoom:n}=this.options;t&&console.time(\\"total time\\");var o=\\"prepare \\".concat(e.length,\\" points\\");t&&console.time(o),this.points=e;for(var i=[],r=0;r=s;d--){var g=+Date.now();h=this.trees[d]=this._createTree(this._cluster(h,d)),t&&console.log(\\"z%d: %d clusters in %dms\\",d,h.numItems,Date.now()-g)}return t&&console.timeEnd(\\"total time\\"),this}getClusters(e,t){var s=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),o=180===e[2]?180:((e[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)s=-180,o=180;else if(s>o){var r=this.getClusters([s,n,180,i],t),a=this.getClusters([-180,n,o,i],t);return r.concat(a)}var l=this.trees[this._limitZoom(t)],u=l.range(eW(s),eN(i),eW(o),eN(n)),p=l.data,c=[];for(var h of u){var d=this.stride*h;c.push(p[d+5]>1?eZ(p,d,this.clusterProps):this.points[p[d+3]])}return c}getChildren(e){var t=this._getOriginId(e),s=this._getOriginZoom(e),n=\\"No cluster with the specified id.\\",o=this.trees[s];if(!o)throw Error(n);var i=o.data;if(t*this.stride>=i.length)throw Error(n);var r=this.options.radius/(this.options.extent*Math.pow(2,s-1)),a=i[t*this.stride],l=i[t*this.stride+1],u=o.within(a,l,r),p=[];for(var c of u){var h=c*this.stride;i[h+4]===e&&p.push(i[h+5]>1?eZ(i,h,this.clusterProps):this.points[i[h+3]])}if(0===p.length)throw Error(n);return p}getLeaves(e,t,s){t=t||10,s=s||0;var n=[];return this._appendLeaves(n,e,t,s,0),n}getTile(e,t,s){var n=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:r}=this.options,a=r/i,l=(s-a)/o,u=(s+1+a)/o,p={features:[]};return this._addTileFeatures(n.range((t-a)/o,l,(t+1+a)/o,u),n.data,t,s,o,p),0===t&&this._addTileFeatures(n.range(1-a/o,l,1,u),n.data,o,s,o,p),t===o-1&&this._addTileFeatures(n.range(0,l,a/o,u),n.data,-1,s,o,p),p.features.length?p:null}getClusterExpansionZoom(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var s=this.getChildren(e);if(t++,1!==s.length)break;e=s[0].properties.cluster_id}return t}_appendLeaves(e,t,s,n,o){for(var i of this.getChildren(t)){var r=i.properties;if(r&&r.cluster?o+r.point_count<=n?o+=r.point_count:o=this._appendLeaves(e,r.cluster_id,s,n,o):o1,u=void 0,p=void 0,c=void 0;if(l)u=eV(t,a,this.clusterProps),p=t[a],c=t[a+1];else{var h=this.points[t[a+3]];u=h.properties;var[d,g]=h.geometry.coordinates;p=eW(d),c=eN(g)}var m={type:1,geometry:[[Math.round(this.options.extent*(p*o-s)),Math.round(this.options.extent*(c*o-n))]],tags:u},v=void 0;void 0!==(v=l||this.options.generateId?t[a+3]:this.points[t[a+3]].id)&&(m.id=v),i.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){for(var{radius:s,extent:n,reduce:o,minPoints:i}=this.options,r=s/(n*Math.pow(2,t)),a=e.data,l=[],u=this.stride,p=0;pt&&(m+=a[f+5])}if(m>g&&m>=i){var y=c*g,b=h*g,L=void 0,E=-1,w=(p/u<<5)+(t+1)+this.points.length;for(var C of d){var x=C*u;if(!(a[x+2]<=t)){a[x+2]=t;var M=a[x+5];y+=a[x]*M,b+=a[x+1]*M,a[x+4]=w,o&&(L||(L=this._map(a,p,!0),E=this.clusterProps.length,this.clusterProps.push(L)),o(L,this._map(a,x)))}}a[p+4]=w,l.push(y/m,b/m,1/0,w,-1,m),o&&l.push(E)}else{for(var k=0;k1)for(var O of d){var P=O*u;if(!(a[P+2]<=t)){a[P+2]=t;for(var S=0;S>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,s){if(e[t+5]>1){var n=this.clusterProps[e[t+6]];return s?Object.assign({},n):n}var o=this.points[e[t+3]].properties,i=this.options.map(o);return s&&i===o?Object.assign({},i):i}}function eZ(e,t,s){return{type:\\"Feature\\",id:e[t+3],properties:eV(e,t,s),geometry:{type:\\"Point\\",coordinates:[(e[t]-.5)*360,360*Math.atan(Math.exp((180-360*e[t+1])*Math.PI/180))/Math.PI-90]}}}function eV(e,t,s){var n=e[t+5],o=n>=1e4?\\"\\".concat(Math.round(n/1e3),\\"k\\"):n>=1e3?\\"\\".concat(Math.round(n/100)/10,\\"k\\"):n,i=e[t+6];return Object.assign(-1===i?{}:Object.assign({},s[i]),{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:o})}function eW(e){return e/360+.5}function eN(e){var t=Math.sin(e*Math.PI/180),s=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return s<0?0:s>1?1:s}function eH(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(s[n]=e[n]);if(null!=e&&\\"function\\"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]]);return s}class eG{static isAdvancedMarkerAvailable(e){return google.maps.marker&&!0===e.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return!!this.isAdvancedMarker(e)||e.getVisible()}}class eF{constructor(e){var{markers:t,position:s}=e;this.markers=t,s&&(s instanceof google.maps.LatLng?this._position=s:this._position=new google.maps.LatLng(s))}get bounds(){if(0!==this.markers.length||this._position){var e=new google.maps.LatLngBounds(this._position,this._position);for(var t of this.markers)e.extend(eG.getPosition(t));return e}}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>eG.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(eG.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class eY{constructor(e){var{maxZoom:t=16}=e;this.maxZoom=t}noop(e){var{markers:t}=e;return eK(t)}}var eK=e=>e.map(e=>new eF({position:eG.getPosition(e),markers:[e]}));class eq extends eY{constructor(e){var{maxZoom:t,radius:s=60}=e,n=eH(e,[\\"maxZoom\\",\\"radius\\"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new eU(Object.assign({maxZoom:this.maxZoom,radius:s},n))}calculate(e){var t=!1,s={zoom:e.map.getZoom()};if(!eI(e.markers,this.markers)){t=!0,this.markers=[...e.markers];var n=this.markers.map(e=>{var t=eG.getPosition(e);return{type:\\"Feature\\",geometry:{type:\\"Point\\",coordinates:[t.lng(),t.lat()]},properties:{marker:e}}});this.superCluster.load(n)}return!t&&(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!eI(this.state,s)),this.state=s,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster(e){var{map:t}=e;return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map(e=>this.transformCluster(e))}transformCluster(e){var{geometry:{coordinates:[t,s]},properties:n}=e;if(n.cluster)return new eF({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(e=>e.properties.marker),position:{lat:s,lng:t}});var o=n.marker;return new eF({markers:[o],position:eG.getPosition(o)})}}class eJ{constructor(e,t){this.markers={sum:e.length};var s=t.map(e=>e.count),n=s.reduce((e,t)=>e+t,0);this.clusters={count:t.length,markers:{mean:n/t.length,sum:n,min:Math.min(...s),max:Math.max(...s)}}}}class eX{render(e,t,s){var{count:n,position:o}=e,i=n>Math.max(10,t.clusters.markers.mean)?\\"#ff0000\\":\\"#0000ff\\",r=\'\\\\n\\\\n\\\\n\\\\n\').concat(n,\\"\\\\n\\"),a=\\"Cluster of \\".concat(n,\\" markers\\"),l=Number(google.maps.Marker.MAX_ZINDEX)+n;if(eG.isAdvancedMarkerAvailable(s)){var u=new DOMParser().parseFromString(r,\\"image/svg+xml\\").documentElement;return u.setAttribute(\\"transform\\",\\"translate(0 25)\\"),new google.maps.marker.AdvancedMarkerElement({map:s,position:o,zIndex:l,title:a,content:u})}var p={position:o,zIndex:l,title:a,icon:{url:\\"data:image/svg+xml;base64,\\".concat(btoa(r)),anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(p)}}class e${constructor(){!function(e,t){for(var s in t.prototype)e.prototype[s]=t.prototype[s]}(e$,google.maps.OverlayView)}}(r=d||(d={})).CLUSTERING_BEGIN=\\"clusteringbegin\\",r.CLUSTERING_END=\\"clusteringend\\",r.CLUSTER_CLICK=\\"click\\";var eQ=(e,t,s)=>{s.fitBounds(t.bounds)};class e0 extends e${constructor(e){var{map:t,markers:s=[],algorithmOptions:n={},algorithm:o=new eq(n),renderer:i=new eX,onClusterClick:r=eQ}=e;super(),this.markers=[...s],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=r,t&&this.setMap(t)}addMarker(e,t){!this.markers.includes(e)&&(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(e=>{this.addMarker(e,!0)}),t||this.render()}removeMarker(e,t){var s=this.markers.indexOf(e);return -1!==s&&(eG.setMap(e,null),this.markers.splice(s,1),t||this.render(),!0)}removeMarkers(e,t){var s=!1;return e.forEach(e=>{s=this.removeMarker(e,!0)||s}),s&&!t&&this.render(),s}clearMarkers(e){this.markers.length=0,e||this.render()}render(){var e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,d.CLUSTERING_BEGIN,this);var{clusters:t,changed:s}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(s||void 0==s){var n=new Set;for(var o of t)1==o.markers.length&&n.add(o.markers[0]);var i=[];for(var r of this.clusters)null!=r.marker&&(1==r.markers.length?n.has(r.marker)||eG.setMap(r.marker,null):i.push(r.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>i.forEach(e=>eG.setMap(e,null)))}google.maps.event.trigger(this,d.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener(\\"idle\\",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>eG.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){var e=new eJ(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(s=>{1===s.markers.length?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,e,t),s.markers.forEach(e=>eG.setMap(e,null)),this.onClusterClick&&s.marker.addListener(\\"click\\",e=>{google.maps.event.trigger(this,d.CLUSTER_CLICK,s),this.onClusterClick(e,s,t)})),eG.setMap(s.marker,t)})}}function e1(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function e2(e){for(var t=1;t{s&&null===n&&o(new e0(e2(e2({},e),{},{map:s})))},[s]),n}(s);return null!==n?t(n):null});var e3={onCloseClick:\\"closeclick\\",onContentChanged:\\"content_changed\\",onDomReady:\\"domready\\",onPositionChanged:\\"position_changed\\",onZindexChanged:\\"zindex_changed\\"},e8={options(e,t){e.setOptions(t)},position(e,t){e.setPosition(t)},zIndex(e,t){e.setZIndex(t)}};(0,m.memo)(function(e){var{children:t,anchor:s,options:n,position:o,zIndex:i,onCloseClick:r,onDomReady:a,onContentChanged:l,onPositionChanged:u,onZindexChanged:p,onLoad:c,onUnmount:h}=e,d=(0,m.useContext)(E),[g,f]=(0,m.useState)(null),[y,b]=(0,m.useState)(null),[w,C]=(0,m.useState)(null),[x,M]=(0,m.useState)(null),[k,O]=(0,m.useState)(null),[P,S]=(0,m.useState)(null),j=(0,m.useRef)(null);return(0,m.useEffect)(()=>{null!==g&&(g.close(),s?g.open(d,s):g.getPosition()&&g.open(d))},[d,g,s]),(0,m.useEffect)(()=>{n&&null!==g&&g.setOptions(n)},[g,n]),(0,m.useEffect)(()=>{o&&null!==g&&g.setPosition(o)},[o]),(0,m.useEffect)(()=>{\\"number\\"==typeof i&&null!==g&&g.setZIndex(i)},[i]),(0,m.useEffect)(()=>{g&&r&&(null!==y&&google.maps.event.removeListener(y),b(google.maps.event.addListener(g,\\"closeclick\\",r)))},[r]),(0,m.useEffect)(()=>{g&&a&&(null!==w&&google.maps.event.removeListener(w),C(google.maps.event.addListener(g,\\"domready\\",a)))},[a]),(0,m.useEffect)(()=>{g&&l&&(null!==x&&google.maps.event.removeListener(x),M(google.maps.event.addListener(g,\\"content_changed\\",l)))},[l]),(0,m.useEffect)(()=>{g&&u&&(null!==k&&google.maps.event.removeListener(k),O(google.maps.event.addListener(g,\\"position_changed\\",u)))},[u]),(0,m.useEffect)(()=>{g&&p&&(null!==P&&google.maps.event.removeListener(P),S(google.maps.event.addListener(g,\\"zindex_changed\\",p)))},[p]),(0,m.useEffect)(()=>{var e=new google.maps.InfoWindow(n);return f(e),j.current=document.createElement(\\"div\\"),r&&b(google.maps.event.addListener(e,\\"closeclick\\",r)),a&&C(google.maps.event.addListener(e,\\"domready\\",a)),l&&M(google.maps.event.addListener(e,\\"content_changed\\",l)),u&&O(google.maps.event.addListener(e,\\"position_changed\\",u)),p&&S(google.maps.event.addListener(e,\\"zindex_changed\\",p)),e.setContent(j.current),o&&e.setPosition(o),i&&e.setZIndex(i),s?e.open(d,s):e.getPosition()?e.open(d):L(!1,\\"You must provide either an anchor (typically render it inside a ) or a position props for .\\"),c&&c(e),()=>{y&&google.maps.event.removeListener(y),x&&google.maps.event.removeListener(x),w&&google.maps.event.removeListener(w),k&&google.maps.event.removeListener(k),P&&google.maps.event.removeListener(P),h&&h(e),e.close()}},[]),j.current?(0,v.createPortal)(m.Children.only(t),j.current):null});class e5 extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"containerElement\\",null),y(this,\\"state\\",{infoWindow:null}),y(this,\\"open\\",(e,t)=>{t?e.open(this.context,t):e.getPosition()?e.open(this.context):L(!1,\\"You must provide either an anchor (typically render it inside a ) or a position props for .\\")}),y(this,\\"setInfoWindowCallback\\",()=>{null!==this.state.infoWindow&&null!==this.containerElement&&(this.state.infoWindow.setContent(this.containerElement),this.open(this.state.infoWindow,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoWindow))})}componentDidMount(){var e=new google.maps.InfoWindow(this.props.options);this.containerElement=document.createElement(\\"div\\"),this.registeredEvents=x({updaterMap:e8,eventMap:e3,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({infoWindow:e}),this.setInfoWindowCallback)}componentDidUpdate(e){null!==this.state.infoWindow&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:e8,eventMap:e3,prevProps:e,nextProps:this.props,instance:this.state.infoWindow}))}componentWillUnmount(){null!==this.state.infoWindow&&(C(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())}render(){return this.containerElement?(0,v.createPortal)(m.Children.only(this.props.children),this.containerElement):null}}function e6(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function e4(e){for(var t=1;t{null!==w&&w.setMap(L)},[L]),(0,m.useEffect)(()=>{void 0!==t&&null!==w&&w.setOptions(t)},[w,t]),(0,m.useEffect)(()=>{void 0!==s&&null!==w&&w.setDraggable(s)},[w,s]),(0,m.useEffect)(()=>{void 0!==n&&null!==w&&w.setEditable(n)},[w,n]),(0,m.useEffect)(()=>{void 0!==o&&null!==w&&w.setVisible(o)},[w,o]),(0,m.useEffect)(()=>{void 0!==i&&null!==w&&w.setPath(i)},[w,i]),(0,m.useEffect)(()=>{w&&r&&(null!==x&&google.maps.event.removeListener(x),M(google.maps.event.addListener(w,\\"dblclick\\",r)))},[r]),(0,m.useEffect)(()=>{w&&a&&(null!==k&&google.maps.event.removeListener(k),O(google.maps.event.addListener(w,\\"dragend\\",a)))},[a]),(0,m.useEffect)(()=>{w&&l&&(null!==P&&google.maps.event.removeListener(P),S(google.maps.event.addListener(w,\\"dragstart\\",l)))},[l]),(0,m.useEffect)(()=>{w&&u&&(null!==j&&google.maps.event.removeListener(j),I(google.maps.event.addListener(w,\\"mousedown\\",u)))},[u]),(0,m.useEffect)(()=>{w&&p&&(null!==D&&google.maps.event.removeListener(D),_(google.maps.event.addListener(w,\\"mousemove\\",p)))},[p]),(0,m.useEffect)(()=>{w&&c&&(null!==B&&google.maps.event.removeListener(B),T(google.maps.event.addListener(w,\\"mouseout\\",c)))},[c]),(0,m.useEffect)(()=>{w&&h&&(null!==R&&google.maps.event.removeListener(R),z(google.maps.event.addListener(w,\\"mouseover\\",h)))},[h]),(0,m.useEffect)(()=>{w&&d&&(null!==A&&google.maps.event.removeListener(A),U(google.maps.event.addListener(w,\\"mouseup\\",d)))},[d]),(0,m.useEffect)(()=>{w&&g&&(null!==Z&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(w,\\"rightclick\\",g)))},[g]),(0,m.useEffect)(()=>{w&&v&&(null!==W&&google.maps.event.removeListener(W),N(google.maps.event.addListener(w,\\"click\\",v)))},[v]),(0,m.useEffect)(()=>{w&&f&&(null!==H&&google.maps.event.removeListener(H),G(google.maps.event.addListener(w,\\"drag\\",f)))},[f]),(0,m.useEffect)(()=>{var e=new google.maps.Polyline(e4(e4({},t||te),{},{map:L}));return i&&e.setPath(i),void 0!==o&&e.setVisible(o),void 0!==n&&e.setEditable(n),void 0!==s&&e.setDraggable(s),r&&M(google.maps.event.addListener(e,\\"dblclick\\",r)),a&&O(google.maps.event.addListener(e,\\"dragend\\",a)),l&&S(google.maps.event.addListener(e,\\"dragstart\\",l)),u&&I(google.maps.event.addListener(e,\\"mousedown\\",u)),p&&_(google.maps.event.addListener(e,\\"mousemove\\",p)),c&&T(google.maps.event.addListener(e,\\"mouseout\\",c)),h&&z(google.maps.event.addListener(e,\\"mouseover\\",h)),d&&U(google.maps.event.addListener(e,\\"mouseup\\",d)),g&&V(google.maps.event.addListener(e,\\"rightclick\\",g)),v&&N(google.maps.event.addListener(e,\\"click\\",v)),f&&G(google.maps.event.addListener(e,\\"drag\\",f)),C(e),y&&y(e),()=>{null!==x&&google.maps.event.removeListener(x),null!==k&&google.maps.event.removeListener(k),null!==P&&google.maps.event.removeListener(P),null!==j&&google.maps.event.removeListener(j),null!==D&&google.maps.event.removeListener(D),null!==B&&google.maps.event.removeListener(B),null!==R&&google.maps.event.removeListener(R),null!==A&&google.maps.event.removeListener(A),null!==Z&&google.maps.event.removeListener(Z),null!==W&&google.maps.event.removeListener(W),b&&b(e),e.setMap(null)}},[]),null});class tt extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{polyline:null}),y(this,\\"setPolylineCallback\\",()=>{null!==this.state.polyline&&this.props.onLoad&&this.props.onLoad(this.state.polyline)})}componentDidMount(){var e=new google.maps.Polyline(e4(e4({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:e7,eventMap:e9,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{polyline:e}},this.setPolylineCallback)}componentDidUpdate(e){null!==this.state.polyline&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:e7,eventMap:e9,prevProps:e,nextProps:this.props,instance:this.state.polyline}))}componentWillUnmount(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),C(this.registeredEvents),this.state.polyline.setMap(null))}render(){return null}}function ts(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tn(e){for(var t=1;t{null!==x&&x.setMap(C)},[C]),(0,m.useEffect)(()=>{void 0!==t&&null!==x&&x.setOptions(t)},[x,t]),(0,m.useEffect)(()=>{void 0!==s&&null!==x&&x.setDraggable(s)},[x,s]),(0,m.useEffect)(()=>{void 0!==n&&null!==x&&x.setEditable(n)},[x,n]),(0,m.useEffect)(()=>{void 0!==o&&null!==x&&x.setVisible(o)},[x,o]),(0,m.useEffect)(()=>{void 0!==i&&null!==x&&x.setPath(i)},[x,i]),(0,m.useEffect)(()=>{void 0!==r&&null!==x&&x.setPaths(r)},[x,r]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof a&&(null!==k&&google.maps.event.removeListener(k),O(google.maps.event.addListener(x,\\"dblclick\\",a)))},[a]),(0,m.useEffect)(()=>{x&&(google.maps.event.addListener(x.getPath(),\\"insert_at\\",()=>{null==w||w(x)}),google.maps.event.addListener(x.getPath(),\\"set_at\\",()=>{null==w||w(x)}),google.maps.event.addListener(x.getPath(),\\"remove_at\\",()=>{null==w||w(x)}))},[x,w]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof l&&(null!==P&&google.maps.event.removeListener(P),S(google.maps.event.addListener(x,\\"dragend\\",l)))},[l]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof u&&(null!==j&&google.maps.event.removeListener(j),I(google.maps.event.addListener(x,\\"dragstart\\",u)))},[u]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof p&&(null!==D&&google.maps.event.removeListener(D),_(google.maps.event.addListener(x,\\"mousedown\\",p)))},[p]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof c&&(null!==B&&google.maps.event.removeListener(B),T(google.maps.event.addListener(x,\\"mousemove\\",c)))},[c]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof h&&(null!==R&&google.maps.event.removeListener(R),z(google.maps.event.addListener(x,\\"mouseout\\",h)))},[h]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof d&&(null!==A&&google.maps.event.removeListener(A),U(google.maps.event.addListener(x,\\"mouseover\\",d)))},[d]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof g&&(null!==Z&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(x,\\"mouseup\\",g)))},[g]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof v&&(null!==W&&google.maps.event.removeListener(W),N(google.maps.event.addListener(x,\\"rightclick\\",v)))},[v]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof f&&(null!==H&&google.maps.event.removeListener(H),G(google.maps.event.addListener(x,\\"click\\",f)))},[f]),(0,m.useEffect)(()=>{x&&\\"function\\"==typeof y&&(null!==F&&google.maps.event.removeListener(F),Y(google.maps.event.addListener(x,\\"drag\\",y)))},[y]),(0,m.useEffect)(()=>{var e=new google.maps.Polygon(tn(tn({},t),{},{map:C}));return i&&e.setPath(i),r&&e.setPaths(r),void 0!==o&&e.setVisible(o),void 0!==n&&e.setEditable(n),void 0!==s&&e.setDraggable(s),a&&O(google.maps.event.addListener(e,\\"dblclick\\",a)),l&&S(google.maps.event.addListener(e,\\"dragend\\",l)),u&&I(google.maps.event.addListener(e,\\"dragstart\\",u)),p&&_(google.maps.event.addListener(e,\\"mousedown\\",p)),c&&T(google.maps.event.addListener(e,\\"mousemove\\",c)),h&&z(google.maps.event.addListener(e,\\"mouseout\\",h)),d&&U(google.maps.event.addListener(e,\\"mouseover\\",d)),g&&V(google.maps.event.addListener(e,\\"mouseup\\",g)),v&&N(google.maps.event.addListener(e,\\"rightclick\\",v)),f&&G(google.maps.event.addListener(e,\\"click\\",f)),y&&Y(google.maps.event.addListener(e,\\"drag\\",y)),M(e),b&&b(e),()=>{null!==k&&google.maps.event.removeListener(k),null!==P&&google.maps.event.removeListener(P),null!==j&&google.maps.event.removeListener(j),null!==D&&google.maps.event.removeListener(D),null!==B&&google.maps.event.removeListener(B),null!==R&&google.maps.event.removeListener(R),null!==A&&google.maps.event.removeListener(A),null!==Z&&google.maps.event.removeListener(Z),null!==W&&google.maps.event.removeListener(W),null!==H&&google.maps.event.removeListener(H),L&&L(e),e.setMap(null)}},[]),null});class tr extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[])}componentDidMount(){var e=this.props.options||{};this.polygon=new google.maps.Polygon(e),this.polygon.setMap(this.context),this.registeredEvents=x({updaterMap:ti,eventMap:to,prevProps:{},nextProps:this.props,instance:this.polygon}),this.props.onLoad&&this.props.onLoad(this.polygon)}componentDidUpdate(e){this.polygon&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:ti,eventMap:to,prevProps:e,nextProps:this.props,instance:this.polygon}))}componentWillUnmount(){this.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.polygon),C(this.registeredEvents),this.polygon&&this.polygon.setMap(null))}render(){return null}}function ta(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tl(e){for(var t=1;t{null!==C&&C.setMap(w)},[w]),(0,m.useEffect)(()=>{void 0!==t&&null!==C&&C.setOptions(t)},[C,t]),(0,m.useEffect)(()=>{void 0!==n&&null!==C&&C.setDraggable(n)},[C,n]),(0,m.useEffect)(()=>{void 0!==o&&null!==C&&C.setEditable(o)},[C,o]),(0,m.useEffect)(()=>{void 0!==i&&null!==C&&C.setVisible(i)},[C,i]),(0,m.useEffect)(()=>{void 0!==s&&null!==C&&C.setBounds(s)},[C,s]),(0,m.useEffect)(()=>{C&&r&&(null!==M&&google.maps.event.removeListener(M),k(google.maps.event.addListener(C,\\"dblclick\\",r)))},[r]),(0,m.useEffect)(()=>{C&&a&&(null!==O&&google.maps.event.removeListener(O),P(google.maps.event.addListener(C,\\"dragend\\",a)))},[a]),(0,m.useEffect)(()=>{C&&l&&(null!==S&&google.maps.event.removeListener(S),j(google.maps.event.addListener(C,\\"dragstart\\",l)))},[l]),(0,m.useEffect)(()=>{C&&u&&(null!==I&&google.maps.event.removeListener(I),D(google.maps.event.addListener(C,\\"mousedown\\",u)))},[u]),(0,m.useEffect)(()=>{C&&p&&(null!==_&&google.maps.event.removeListener(_),B(google.maps.event.addListener(C,\\"mousemove\\",p)))},[p]),(0,m.useEffect)(()=>{C&&c&&(null!==T&&google.maps.event.removeListener(T),R(google.maps.event.addListener(C,\\"mouseout\\",c)))},[c]),(0,m.useEffect)(()=>{C&&h&&(null!==z&&google.maps.event.removeListener(z),A(google.maps.event.addListener(C,\\"mouseover\\",h)))},[h]),(0,m.useEffect)(()=>{C&&d&&(null!==U&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(C,\\"mouseup\\",d)))},[d]),(0,m.useEffect)(()=>{C&&g&&(null!==V&&google.maps.event.removeListener(V),W(google.maps.event.addListener(C,\\"rightclick\\",g)))},[g]),(0,m.useEffect)(()=>{C&&v&&(null!==N&&google.maps.event.removeListener(N),H(google.maps.event.addListener(C,\\"click\\",v)))},[v]),(0,m.useEffect)(()=>{C&&f&&(null!==G&&google.maps.event.removeListener(G),F(google.maps.event.addListener(C,\\"drag\\",f)))},[f]),(0,m.useEffect)(()=>{C&&y&&(null!==Y&&google.maps.event.removeListener(Y),K(google.maps.event.addListener(C,\\"bounds_changed\\",y)))},[y]),(0,m.useEffect)(()=>{var e=new google.maps.Rectangle(tl(tl({},t),{},{map:w}));return void 0!==i&&e.setVisible(i),void 0!==o&&e.setEditable(o),void 0!==n&&e.setDraggable(n),void 0!==s&&e.setBounds(s),r&&k(google.maps.event.addListener(e,\\"dblclick\\",r)),a&&P(google.maps.event.addListener(e,\\"dragend\\",a)),l&&j(google.maps.event.addListener(e,\\"dragstart\\",l)),u&&D(google.maps.event.addListener(e,\\"mousedown\\",u)),p&&B(google.maps.event.addListener(e,\\"mousemove\\",p)),c&&R(google.maps.event.addListener(e,\\"mouseout\\",c)),h&&A(google.maps.event.addListener(e,\\"mouseover\\",h)),d&&Z(google.maps.event.addListener(e,\\"mouseup\\",d)),g&&W(google.maps.event.addListener(e,\\"rightclick\\",g)),v&&H(google.maps.event.addListener(e,\\"click\\",v)),f&&F(google.maps.event.addListener(e,\\"drag\\",f)),y&&K(google.maps.event.addListener(e,\\"bounds_changed\\",y)),x(e),b&&b(e),()=>{null!==M&&google.maps.event.removeListener(M),null!==O&&google.maps.event.removeListener(O),null!==S&&google.maps.event.removeListener(S),null!==I&&google.maps.event.removeListener(I),null!==_&&google.maps.event.removeListener(_),null!==T&&google.maps.event.removeListener(T),null!==z&&google.maps.event.removeListener(z),null!==U&&google.maps.event.removeListener(U),null!==V&&google.maps.event.removeListener(V),null!==N&&google.maps.event.removeListener(N),null!==G&&google.maps.event.removeListener(G),null!==Y&&google.maps.event.removeListener(Y),L&&L(e),e.setMap(null)}},[]),null});class tc extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{rectangle:null}),y(this,\\"setRectangleCallback\\",()=>{null!==this.state.rectangle&&this.props.onLoad&&this.props.onLoad(this.state.rectangle)})}componentDidMount(){var e=new google.maps.Rectangle(tl(tl({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:tp,eventMap:tu,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{rectangle:e}},this.setRectangleCallback)}componentDidUpdate(e){null!==this.state.rectangle&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:tp,eventMap:tu,prevProps:e,nextProps:this.props,instance:this.state.rectangle}))}componentWillUnmount(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),C(this.registeredEvents),this.state.rectangle.setMap(null))}render(){return null}}function th(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function td(e){for(var t=1;t{null!==M&&M.setMap(x)},[x]),(0,m.useEffect)(()=>{void 0!==t&&null!==M&&M.setOptions(t)},[M,t]),(0,m.useEffect)(()=>{void 0!==o&&null!==M&&M.setDraggable(o)},[M,o]),(0,m.useEffect)(()=>{void 0!==i&&null!==M&&M.setEditable(i)},[M,i]),(0,m.useEffect)(()=>{void 0!==r&&null!==M&&M.setVisible(r)},[M,r]),(0,m.useEffect)(()=>{\\"number\\"==typeof n&&null!==M&&M.setRadius(n)},[M,n]),(0,m.useEffect)(()=>{void 0!==s&&null!==M&&M.setCenter(s)},[M,s]),(0,m.useEffect)(()=>{M&&a&&(null!==O&&google.maps.event.removeListener(O),P(google.maps.event.addListener(M,\\"dblclick\\",a)))},[a]),(0,m.useEffect)(()=>{M&&l&&(null!==S&&google.maps.event.removeListener(S),j(google.maps.event.addListener(M,\\"dragend\\",l)))},[l]),(0,m.useEffect)(()=>{M&&u&&(null!==I&&google.maps.event.removeListener(I),D(google.maps.event.addListener(M,\\"dragstart\\",u)))},[u]),(0,m.useEffect)(()=>{M&&p&&(null!==_&&google.maps.event.removeListener(_),B(google.maps.event.addListener(M,\\"mousedown\\",p)))},[p]),(0,m.useEffect)(()=>{M&&c&&(null!==T&&google.maps.event.removeListener(T),R(google.maps.event.addListener(M,\\"mousemove\\",c)))},[c]),(0,m.useEffect)(()=>{M&&h&&(null!==z&&google.maps.event.removeListener(z),A(google.maps.event.addListener(M,\\"mouseout\\",h)))},[h]),(0,m.useEffect)(()=>{M&&d&&(null!==U&&google.maps.event.removeListener(U),Z(google.maps.event.addListener(M,\\"mouseover\\",d)))},[d]),(0,m.useEffect)(()=>{M&&g&&(null!==V&&google.maps.event.removeListener(V),W(google.maps.event.addListener(M,\\"mouseup\\",g)))},[g]),(0,m.useEffect)(()=>{M&&v&&(null!==N&&google.maps.event.removeListener(N),H(google.maps.event.addListener(M,\\"rightclick\\",v)))},[v]),(0,m.useEffect)(()=>{M&&f&&(null!==G&&google.maps.event.removeListener(G),F(google.maps.event.addListener(M,\\"click\\",f)))},[f]),(0,m.useEffect)(()=>{M&&y&&(null!==Y&&google.maps.event.removeListener(Y),K(google.maps.event.addListener(M,\\"drag\\",y)))},[y]),(0,m.useEffect)(()=>{M&&b&&(null!==q&&google.maps.event.removeListener(q),J(google.maps.event.addListener(M,\\"center_changed\\",b)))},[f]),(0,m.useEffect)(()=>{M&&L&&(null!==X&&google.maps.event.removeListener(X),$(google.maps.event.addListener(M,\\"radius_changed\\",L)))},[L]),(0,m.useEffect)(()=>{var e=new google.maps.Circle(td(td({},t||tv),{},{map:x}));return\\"number\\"==typeof n&&e.setRadius(n),void 0!==s&&e.setCenter(s),\\"number\\"==typeof n&&e.setRadius(n),void 0!==r&&e.setVisible(r),void 0!==i&&e.setEditable(i),void 0!==o&&e.setDraggable(o),a&&P(google.maps.event.addListener(e,\\"dblclick\\",a)),l&&j(google.maps.event.addListener(e,\\"dragend\\",l)),u&&D(google.maps.event.addListener(e,\\"dragstart\\",u)),p&&B(google.maps.event.addListener(e,\\"mousedown\\",p)),c&&R(google.maps.event.addListener(e,\\"mousemove\\",c)),h&&A(google.maps.event.addListener(e,\\"mouseout\\",h)),d&&Z(google.maps.event.addListener(e,\\"mouseover\\",d)),g&&W(google.maps.event.addListener(e,\\"mouseup\\",g)),v&&H(google.maps.event.addListener(e,\\"rightclick\\",v)),f&&F(google.maps.event.addListener(e,\\"click\\",f)),y&&K(google.maps.event.addListener(e,\\"drag\\",y)),b&&J(google.maps.event.addListener(e,\\"center_changed\\",b)),L&&$(google.maps.event.addListener(e,\\"radius_changed\\",L)),k(e),w&&w(e),()=>{null!==O&&google.maps.event.removeListener(O),null!==S&&google.maps.event.removeListener(S),null!==I&&google.maps.event.removeListener(I),null!==_&&google.maps.event.removeListener(_),null!==T&&google.maps.event.removeListener(T),null!==z&&google.maps.event.removeListener(z),null!==U&&google.maps.event.removeListener(U),null!==V&&google.maps.event.removeListener(V),null!==N&&google.maps.event.removeListener(N),null!==G&&google.maps.event.removeListener(G),null!==q&&google.maps.event.removeListener(q),null!==X&&google.maps.event.removeListener(X),C&&C(e),e.setMap(null)}},[]),null});class tf extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{circle:null}),y(this,\\"setCircleCallback\\",()=>{null!==this.state.circle&&this.props.onLoad&&this.props.onLoad(this.state.circle)})}componentDidMount(){var e=new google.maps.Circle(td(td({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:tm,eventMap:tg,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{circle:e}},this.setCircleCallback)}componentDidUpdate(e){null!==this.state.circle&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:tm,eventMap:tg,prevProps:e,nextProps:this.props,instance:this.state.circle}))}componentWillUnmount(){if(null!==this.state.circle){var e;this.props.onUnmount&&this.props.onUnmount(this.state.circle),C(this.registeredEvents),null==(e=this.state.circle)||e.setMap(null)}}render(){return null}}function ty(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tb(e){for(var t=1;t{null!==b&&b.setMap(y)},[y]),(0,m.useEffect)(()=>{b&&n&&(null!==w&&google.maps.event.removeListener(w),C(google.maps.event.addListener(b,\\"dblclick\\",n)))},[n]),(0,m.useEffect)(()=>{b&&o&&(null!==x&&google.maps.event.removeListener(x),M(google.maps.event.addListener(b,\\"mousedown\\",o)))},[o]),(0,m.useEffect)(()=>{b&&i&&(null!==k&&google.maps.event.removeListener(k),O(google.maps.event.addListener(b,\\"mousemove\\",i)))},[i]),(0,m.useEffect)(()=>{b&&r&&(null!==P&&google.maps.event.removeListener(P),S(google.maps.event.addListener(b,\\"mouseout\\",r)))},[r]),(0,m.useEffect)(()=>{b&&a&&(null!==j&&google.maps.event.removeListener(j),I(google.maps.event.addListener(b,\\"mouseover\\",a)))},[a]),(0,m.useEffect)(()=>{b&&l&&(null!==D&&google.maps.event.removeListener(D),_(google.maps.event.addListener(b,\\"mouseup\\",l)))},[l]),(0,m.useEffect)(()=>{b&&u&&(null!==B&&google.maps.event.removeListener(B),T(google.maps.event.addListener(b,\\"rightclick\\",u)))},[u]),(0,m.useEffect)(()=>{b&&s&&(null!==R&&google.maps.event.removeListener(R),z(google.maps.event.addListener(b,\\"click\\",s)))},[s]),(0,m.useEffect)(()=>{b&&p&&(null!==A&&google.maps.event.removeListener(A),U(google.maps.event.addListener(b,\\"addfeature\\",p)))},[p]),(0,m.useEffect)(()=>{b&&c&&(null!==Z&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(b,\\"removefeature\\",c)))},[c]),(0,m.useEffect)(()=>{b&&h&&(null!==W&&google.maps.event.removeListener(W),N(google.maps.event.addListener(b,\\"removeproperty\\",h)))},[h]),(0,m.useEffect)(()=>{b&&d&&(null!==H&&google.maps.event.removeListener(H),G(google.maps.event.addListener(b,\\"setgeometry\\",d)))},[d]),(0,m.useEffect)(()=>{b&&g&&(null!==F&&google.maps.event.removeListener(F),Y(google.maps.event.addListener(b,\\"setproperty\\",g)))},[g]),(0,m.useEffect)(()=>{if(null!==y){var e=new google.maps.Data(tb(tb({},t),{},{map:y}));n&&C(google.maps.event.addListener(e,\\"dblclick\\",n)),o&&M(google.maps.event.addListener(e,\\"mousedown\\",o)),i&&O(google.maps.event.addListener(e,\\"mousemove\\",i)),r&&S(google.maps.event.addListener(e,\\"mouseout\\",r)),a&&I(google.maps.event.addListener(e,\\"mouseover\\",a)),l&&_(google.maps.event.addListener(e,\\"mouseup\\",l)),u&&T(google.maps.event.addListener(e,\\"rightclick\\",u)),s&&z(google.maps.event.addListener(e,\\"click\\",s)),p&&U(google.maps.event.addListener(e,\\"addfeature\\",p)),c&&V(google.maps.event.addListener(e,\\"removefeature\\",c)),h&&N(google.maps.event.addListener(e,\\"removeproperty\\",h)),d&&G(google.maps.event.addListener(e,\\"setgeometry\\",d)),g&&Y(google.maps.event.addListener(e,\\"setproperty\\",g)),L(e),v&&v(e)}return()=>{b&&(null!==w&&google.maps.event.removeListener(w),null!==x&&google.maps.event.removeListener(x),null!==k&&google.maps.event.removeListener(k),null!==P&&google.maps.event.removeListener(P),null!==j&&google.maps.event.removeListener(j),null!==D&&google.maps.event.removeListener(D),null!==B&&google.maps.event.removeListener(B),null!==R&&google.maps.event.removeListener(R),null!==A&&google.maps.event.removeListener(A),null!==Z&&google.maps.event.removeListener(Z),null!==W&&google.maps.event.removeListener(W),null!==H&&google.maps.event.removeListener(H),null!==F&&google.maps.event.removeListener(F),f&&f(b),b.setMap(null))}},[]),null});class tw extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{data:null}),y(this,\\"setDataCallback\\",()=>{null!==this.state.data&&this.props.onLoad&&this.props.onLoad(this.state.data)})}componentDidMount(){if(null!==this.context){var e=new google.maps.Data(tb(tb({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:tE,eventMap:tL,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({data:e}),this.setDataCallback)}}componentDidUpdate(e){null!==this.state.data&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:tE,eventMap:tL,prevProps:e,nextProps:this.props,instance:this.state.data}))}componentWillUnmount(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),C(this.registeredEvents),this.state.data&&this.state.data.setMap(null))}render(){return null}}function tC(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tx(e){for(var t=1;t{null!==this.state.kmlLayer&&this.props.onLoad&&this.props.onLoad(this.state.kmlLayer)})}componentDidMount(){var e=new google.maps.KmlLayer(tx(tx({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:tk,eventMap:tM,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{kmlLayer:e}},this.setKmlLayerCallback)}componentDidUpdate(e){null!==this.state.kmlLayer&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:tk,eventMap:tM,prevProps:e,nextProps:this.props,instance:this.state.kmlLayer}))}componentWillUnmount(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),C(this.registeredEvents),this.state.kmlLayer.setMap(null))}render(){return null}}function tP(e,t){return\\"function\\"==typeof t?t(e.offsetWidth,e.offsetHeight):{x:0,y:0}}function tS(e,t){return new t(e.lat,e.lng)}function tj(e,t){return new t(new google.maps.LatLng(e.ne.lat,e.ne.lng),new google.maps.LatLng(e.sw.lat,e.sw.lng))}function tI(e,t,s,n){var o,i,r,a,l;return void 0!==s?(o=google.maps.LatLngBounds,i=s instanceof o?s:tj(s,o),r=e&&e.fromLatLngToDivPixel(i.getNorthEast()),a=e&&e.fromLatLngToDivPixel(i.getSouthWest()),r&&a?{left:\\"\\".concat(a.x+t.x,\\"px\\"),top:\\"\\".concat(r.y+t.y,\\"px\\"),width:\\"\\".concat(r.x-a.x-t.x,\\"px\\"),height:\\"\\".concat(a.y-r.y-t.y,\\"px\\")}:{left:\\"-9999px\\",top:\\"-9999px\\"}):function(e,t,s){var n=e&&e.fromLatLngToDivPixel(s);if(n){var{x:o,y:i}=n;return{left:\\"\\".concat(o+t.x,\\"px\\"),top:\\"\\".concat(i+t.y,\\"px\\")}}return{left:\\"-9999px\\",top:\\"-9999px\\"}}(e,t,(l=google.maps.LatLng,n instanceof l?n:tS(n,l)))}function tD(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function t_(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tB(e){return e?(e instanceof google.maps.LatLng?e:new google.maps.LatLng(e.lat,e.lng))+\\"\\":\\"\\"}function tT(e){return e?(e instanceof google.maps.LatLngBounds?e:new google.maps.LatLngBounds(new google.maps.LatLng(e.south,e.east),new google.maps.LatLng(e.north,e.west)))+\\"\\":\\"\\"}y(tO,\\"contextType\\",E),(0,m.memo)(function(e){var{position:t,bounds:s,mapPaneName:n,zIndex:o,onLoad:i,onUnmount:r,getPixelPositionOffset:a,children:l}=e,u=(0,m.useContext)(E),p=(0,m.useMemo)(()=>{var e=document.createElement(\\"div\\");return e.style.position=\\"absolute\\",e},[]),c=(0,m.useMemo)(()=>(function(e,t,s,n,o){class i extends google.maps.OverlayView{constructor(e,t,s,n){super(),this.container=e,this.pane=t,this.position=s,this.bounds=n}onAdd(){var e,t=null==(e=this.getPanes())?void 0:e[this.pane];null==t||t.appendChild(this.container)}draw(){for(var[e,t]of Object.entries(tI(this.getProjection(),function(e){for(var t=1;t(null==i||i(c),null==c||c.setMap(u),()=>{null==r||r(c),null==c||c.setMap(null)}),[u,c]),(0,m.useEffect)(()=>{p.style.zIndex=\\"\\".concat(o)},[o,p]),v.createPortal(l,p)});class tR extends m.PureComponent{constructor(e){super(e),y(this,\\"state\\",{paneEl:null,containerStyle:{position:\\"absolute\\"}}),y(this,\\"updatePane\\",()=>{var e=this.props.mapPaneName,t=this.overlayView.getPanes();L(!!e,\\"OverlayView requires props.mapPaneName but got %s\\",e),t?this.setState({paneEl:t[e]}):this.setState({paneEl:null})}),y(this,\\"onAdd\\",()=>{var e,t;this.updatePane(),null==(e=(t=this.props).onLoad)||e.call(t,this.overlayView)}),y(this,\\"onPositionElement\\",()=>{var e,t,s,n,o,i=tI(this.overlayView.getProjection(),function(e){for(var t=1;t{this.onPositionElement()}),y(this,\\"onRemove\\",()=>{var e,t;this.setState(()=>({paneEl:null})),null==(e=(t=this.props).onUnmount)||e.call(t,this.overlayView)}),this.containerRef=(0,m.createRef)();var t=new google.maps.OverlayView;t.onAdd=this.onAdd,t.draw=this.draw,t.onRemove=this.onRemove,this.overlayView=t}componentDidMount(){this.overlayView.setMap(this.context)}componentDidUpdate(e){var t=tB(e.position),s=tB(this.props.position),n=tT(e.bounds),o=tT(this.props.bounds);(t!==s||n!==o)&&this.overlayView.draw(),e.mapPaneName!==this.props.mapPaneName&&this.updatePane()}componentWillUnmount(){this.overlayView.setMap(null)}render(){var e=this.state.paneEl;return e?v.createPortal((0,g.jsx)(\\"div\\",{ref:this.containerRef,style:this.state.containerStyle,children:m.Children.only(this.props.children)}),e):null}}function tz(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tA(e){for(var t=1;tnew google.maps.GroundOverlay(t,r,n),[]);return(0,m.useEffect)(()=>{null!==a&&a.setMap(i)},[i]),(0,m.useEffect)(()=>{void 0!==t&&null!==a&&(a.set(\\"url\\",t),a.setMap(i))},[a,t]),(0,m.useEffect)(()=>{void 0!==o&&null!==a&&a.setOpacity(+!!o)},[a,o]),(0,m.useEffect)(()=>{var e=new google.maps.LatLngBounds(new google.maps.LatLng(s.south,s.west),new google.maps.LatLng(s.north,s.east));void 0!==s&&null!==a&&(a.set(\\"bounds\\",e),a.setMap(i))},[a,s]),null});class tV extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{groundOverlay:null}),y(this,\\"setGroundOverlayCallback\\",()=>{null!==this.state.groundOverlay&&this.props.onLoad&&this.props.onLoad(this.state.groundOverlay)})}componentDidMount(){L(!!this.props.url||!!this.props.bounds,\\"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you\'ll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React\'s key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655\\");var e=new google.maps.GroundOverlay(this.props.url,this.props.bounds,tA(tA({},this.props.options),{},{map:this.context}));this.registeredEvents=x({updaterMap:tZ,eventMap:tU,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{groundOverlay:e}},this.setGroundOverlayCallback)}componentDidUpdate(e){null!==this.state.groundOverlay&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:tZ,eventMap:tU,prevProps:e,nextProps:this.props,instance:this.state.groundOverlay}))}componentWillUnmount(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))}render(){return null}}function tW(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function tN(e){for(var t=1;t{google.maps.visualization||L(!!google.maps.visualization,\'Did you include prop libraries={[\\"visualization\\"]} in useJsApiScript? %s\',google.maps.visualization)},[]),(0,m.useEffect)(()=>{L(!!t,\\"data property is required in HeatmapLayer %s\\",t)},[t]),(0,m.useEffect)(()=>{null!==r&&r.setMap(i)},[i]),(0,m.useEffect)(()=>{o&&null!==r&&r.setOptions(o)},[r,o]),(0,m.useEffect)(()=>{var e=new google.maps.visualization.HeatmapLayer(tN(tN({},o),{},{data:t,map:i}));return a(e),s&&s(e),()=>{null!==r&&(n&&n(r),r.setMap(null))}},[]),null});class tF extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{heatmapLayer:null}),y(this,\\"setHeatmapLayerCallback\\",()=>{null!==this.state.heatmapLayer&&this.props.onLoad&&this.props.onLoad(this.state.heatmapLayer)})}componentDidMount(){L(!!google.maps.visualization,\'Did you include prop libraries={[\\"visualization\\"]} to ? %s\',google.maps.visualization),L(!!this.props.data,\\"data property is required in HeatmapLayer %s\\",this.props.data);var e=new google.maps.visualization.HeatmapLayer(tN(tN({},this.props.options),{},{data:this.props.data,map:this.context}));this.registeredEvents=x({updaterMap:tG,eventMap:tH,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{heatmapLayer:e}},this.setHeatmapLayerCallback)}componentDidUpdate(e){C(this.registeredEvents),this.registeredEvents=x({updaterMap:tG,eventMap:tH,prevProps:e,nextProps:this.props,instance:this.state.heatmapLayer})}componentWillUnmount(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),C(this.registeredEvents),this.state.heatmapLayer.setMap(null))}render(){return null}}y(tF,\\"contextType\\",E);var tY={onCloseClick:\\"closeclick\\",onPanoChanged:\\"pano_changed\\",onPositionChanged:\\"position_changed\\",onPovChanged:\\"pov_changed\\",onResize:\\"resize\\",onStatusChanged:\\"status_changed\\",onVisibleChanged:\\"visible_changed\\",onZoomChanged:\\"zoom_changed\\"},tK={register(e,t,s){e.registerPanoProvider(t,s)},links(e,t){e.setLinks(t)},motionTracking(e,t){e.setMotionTracking(t)},options(e,t){e.setOptions(t)},pano(e,t){e.setPano(t)},position(e,t){e.setPosition(t)},pov(e,t){e.setPov(t)},visible(e,t){e.setVisible(t)},zoom(e,t){e.setZoom(t)}};class tq extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{streetViewPanorama:null}),y(this,\\"setStreetViewPanoramaCallback\\",()=>{null!==this.state.streetViewPanorama&&this.props.onLoad&&this.props.onLoad(this.state.streetViewPanorama)})}componentDidMount(){var e,t,s=null!=(e=null==(t=this.context)?void 0:t.getStreetView())?e:null;this.registeredEvents=x({updaterMap:tK,eventMap:tY,prevProps:{},nextProps:this.props,instance:s}),this.setState(()=>({streetViewPanorama:s}),this.setStreetViewPanoramaCallback)}componentDidUpdate(e){null!==this.state.streetViewPanorama&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:tK,eventMap:tY,prevProps:e,nextProps:this.props,instance:this.state.streetViewPanorama}))}componentWillUnmount(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),C(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))}render(){return null}}y(tq,\\"contextType\\",E);class tJ extends m.PureComponent{constructor(){super(...arguments),y(this,\\"state\\",{streetViewService:null}),y(this,\\"setStreetViewServiceCallback\\",()=>{null!==this.state.streetViewService&&this.props.onLoad&&this.props.onLoad(this.state.streetViewService)})}componentDidMount(){var e=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:e}},this.setStreetViewServiceCallback)}componentWillUnmount(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)}render(){return null}}y(tJ,\\"contextType\\",E),m.PureComponent;var tX={onDirectionsChanged:\\"directions_changed\\"},t$={directions(e,t){e.setDirections(t)},map(e,t){e.setMap(t)},options(e,t){e.setOptions(t)},panel(e,t){e.setPanel(t)},routeIndex(e,t){e.setRouteIndex(t)}};class tQ extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"state\\",{directionsRenderer:null}),y(this,\\"setDirectionsRendererCallback\\",()=>{null!==this.state.directionsRenderer&&(this.state.directionsRenderer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.directionsRenderer))})}componentDidMount(){var e=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=x({updaterMap:t$,eventMap:tX,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{directionsRenderer:e}},this.setDirectionsRendererCallback)}componentDidUpdate(e){null!==this.state.directionsRenderer&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:t$,eventMap:tX,prevProps:e,nextProps:this.props,instance:this.state.directionsRenderer}))}componentWillUnmount(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),C(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))}render(){return null}}y(tQ,\\"contextType\\",E),m.PureComponent;var t0={onPlacesChanged:\\"places_changed\\"},t1={bounds(e,t){e.setBounds(t)}};class t2 extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"containerElement\\",(0,m.createRef)()),y(this,\\"state\\",{searchBox:null}),y(this,\\"setSearchBoxCallback\\",()=>{null!==this.state.searchBox&&this.props.onLoad&&this.props.onLoad(this.state.searchBox)})}componentDidMount(){if(L(!!google.maps.places,\'You need to provide libraries={[\\"places\\"]} prop to component %s\',google.maps.places),null!==this.containerElement&&null!==this.containerElement.current){var e=this.containerElement.current.querySelector(\\"input\\");if(null!==e){var t=new google.maps.places.SearchBox(e,this.props.options);this.registeredEvents=x({updaterMap:t1,eventMap:t0,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{searchBox:t}},this.setSearchBoxCallback)}}}componentDidUpdate(e){null!==this.state.searchBox&&(C(this.registeredEvents),this.registeredEvents=x({updaterMap:t1,eventMap:t0,prevProps:e,nextProps:this.props,instance:this.state.searchBox}))}componentWillUnmount(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),C(this.registeredEvents))}render(){return(0,g.jsx)(\\"div\\",{ref:this.containerElement,children:m.Children.only(this.props.children)})}}y(t2,\\"contextType\\",E);var t3={onPlaceChanged:\\"place_changed\\"},t8={bounds(e,t){e.setBounds(t)},restrictions(e,t){e.setComponentRestrictions(t)},fields(e,t){e.setFields(t)},options(e,t){e.setOptions(t)},types(e,t){e.setTypes(t)}};class t5 extends m.PureComponent{constructor(){super(...arguments),y(this,\\"registeredEvents\\",[]),y(this,\\"containerElement\\",(0,m.createRef)()),y(this,\\"state\\",{autocomplete:null}),y(this,\\"setAutocompleteCallback\\",()=>{null!==this.state.autocomplete&&this.props.onLoad&&this.props.onLoad(this.state.autocomplete)})}componentDidMount(){L(!!google.maps.places,\'You need to provide libraries={[\\"places\\"]} prop to component %s\',google.maps.places);var e,t=null==(e=this.containerElement.current)?void 0:e.querySelector(\\"input\\");if(t){var s=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=x({updaterMap:t8,eventMap:t3,prevProps:{},nextProps:this.props,instance:s}),this.setState(()=>({autocomplete:s}),this.setAutocompleteCallback)}}componentDidUpdate(e){C(this.registeredEvents),this.registeredEvents=x({updaterMap:t8,eventMap:t3,prevProps:e,nextProps:this.props,instance:this.state.autocomplete})}componentWillUnmount(){null!==this.state.autocomplete&&C(this.registeredEvents)}render(){return(0,g.jsx)(\\"div\\",{ref:this.containerElement,className:this.props.className,children:m.Children.only(this.props.children)})}}y(t5,\\"defaultProps\\",{className:\\"\\"}),y(t5,\\"contextType\\",E)}}]);"},{"name":"framework-292291387d6b2e39.js","path":"apps/web/out/_next/static/chunks/framework-292291387d6b2e39.js","area":"FRONTEND","folder":"CHUNKS","content":"\\"use strict\\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[593],{2167:(e,t,n)=>{var r=n(5364),l=Symbol.for(\\"react.transitional.element\\"),a=Symbol.for(\\"react.portal\\"),o=Symbol.for(\\"react.fragment\\"),i=Symbol.for(\\"react.strict_mode\\"),u=Symbol.for(\\"react.profiler\\"),s=Symbol.for(\\"react.consumer\\"),c=Symbol.for(\\"react.context\\"),f=Symbol.for(\\"react.forward_ref\\"),d=Symbol.for(\\"react.suspense\\"),p=Symbol.for(\\"react.memo\\"),m=Symbol.for(\\"react.lazy\\"),h=Symbol.for(\\"react.activity\\"),g=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function k(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||y}function w(){}function S(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||y}k.prototype.isReactComponent={},k.prototype.setState=function(e,t){if(\\"object\\"!=typeof e&&\\"function\\"!=typeof e&&null!=e)throw Error(\\"takes an object of state variables to update or a function which returns an object of state variables.\\");this.updater.enqueueSetState(this,e,t,\\"setState\\")},k.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\\"forceUpdate\\")},w.prototype=k.prototype;var x=S.prototype=new w;x.constructor=S,v(x,k.prototype),x.isPureReactComponent=!0;var E=Array.isArray;function C(){}var _={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function P(e,t,n){var r=n.ref;return{$$typeof:l,type:e,key:t,ref:void 0!==r?r:null,props:n}}function N(e){return\\"object\\"==typeof e&&null!==e&&e.$$typeof===l}var T=/\\\\/+/g;function L(e,t){var n,r;return\\"object\\"==typeof e&&null!==e&&null!=e.key?(n=\\"\\"+e.key,r={\\"=\\":\\"=0\\",\\":\\":\\"=2\\"},\\"$\\"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36)}function O(e,t,n){if(null==e)return e;var r=[],o=0;return!function e(t,n,r,o,i){var u,s,c,f=typeof t;(\\"undefined\\"===f||\\"boolean\\"===f)&&(t=null);var d=!1;if(null===t)d=!0;else switch(f){case\\"bigint\\":case\\"string\\":case\\"number\\":d=!0;break;case\\"object\\":switch(t.$$typeof){case l:case a:d=!0;break;case m:return e((d=t._init)(t._payload),n,r,o,i)}}if(d)return i=i(t),d=\\"\\"===o?\\".\\"+L(t,0):o,E(i)?(r=\\"\\",null!=d&&(r=d.replace(T,\\"$&/\\")+\\"/\\"),e(i,n,r,\\"\\",function(e){return e})):null!=i&&(N(i)&&(u=i,s=r+(null==i.key||t&&t.key===i.key?\\"\\":(\\"\\"+i.key).replace(T,\\"$&/\\")+\\"/\\")+d,i=P(u.type,s,u.props)),n.push(i)),1;d=0;var p=\\"\\"===o?\\".\\":o+\\":\\";if(E(t))for(var h=0;h{e.exports=n(5919)},4232:(e,t,n)=>{e.exports=n(2167)},4279:(e,t,n)=>{var r,l=n(5364),a=n(2786),o=n(4232),i=n(8477);function u(e){var t=\\"https://react.dev/errors/\\"+e;if(1I||(e.current=M[I],M[I]=null,I--)}function j(e,t){M[++I]=e.current,e.current=t}var H=U(null),V=U(null),B=U(null),Q=U(null);function W(e,t){switch(j(B,t),j(V,e),j(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sb(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=sk(t=sb(t),e);else switch(e){case\\"svg\\":e=1;break;case\\"math\\":e=2;break;default:e=0}}$(H),j(H,e)}function q(){$(H),$(V),$(B)}function K(e){null!==e.memoizedState&&j(Q,e);var t=H.current,n=sk(t,e.type);t!==n&&(j(V,e),j(H,n))}function Y(e){V.current===e&&($(H),$(V)),Q.current===e&&($(Q),cn._currentValue=A)}function G(e){if(void 0===tI)try{throw Error()}catch(e){var t=e.stack.trim().match(/\\\\n( *(at )?)/);tI=t&&t[1]||\\"\\",tU=-1)\\":-1l||u[r]!==s[l]){var c=\\"\\\\n\\"+u[r].replace(\\" at new \\",\\" at \\");return e.displayName&&c.includes(\\"\\")&&(c=c.replace(\\"\\",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{X=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\\"\\")?G(n):\\"\\"}function J(e){try{var t=\\"\\",n=null;do t+=function(e,t){switch(e.tag){case 26:case 27:case 5:return G(e.type);case 16:return G(\\"Lazy\\");case 13:return e.child!==t&&null!==t?G(\\"Suspense Fallback\\"):G(\\"Suspense\\");case 19:return G(\\"SuspenseList\\");case 0:case 15:return Z(e.type,!1);case 11:return Z(e.type.render,!1);case 1:return Z(e.type,!0);case 31:return G(\\"Activity\\");default:return\\"\\"}}(e,n),n=e,e=e.return;while(e);return t}catch(e){return\\"\\\\nError generating stack: \\"+e.message+\\"\\\\n\\"+e.stack}}var ee=Object.prototype.hasOwnProperty,et=a.unstable_scheduleCallback,en=a.unstable_cancelCallback,er=a.unstable_shouldYield,el=a.unstable_requestPaint,ea=a.unstable_now,eo=a.unstable_getCurrentPriorityLevel,ei=a.unstable_ImmediatePriority,eu=a.unstable_UserBlockingPriority,es=a.unstable_NormalPriority,ec=a.unstable_LowPriority,ef=a.unstable_IdlePriority,ed=a.log,ep=a.unstable_setDisableYieldValue,em=null,eh=null;function eg(e){if(\\"function\\"==typeof ed&&ep(e),eh&&\\"function\\"==typeof eh.setStrictMode)try{eh.setStrictMode(em,e)}catch(e){}}var ey=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(ev(e)/eb|0)|0},ev=Math.log,eb=Math.LN2,ek=256,ew=262144,eS=4194304;function ex(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function eE(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var l=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var i=0x7ffffff&r;return 0!==i?0!=(r=i&~a)?l=ex(r):0!=(o&=i)?l=ex(o):n||0!=(n=i&~e)&&(l=ex(n)):0!=(i=r&~a)?l=ex(i):0!==o?l=ex(o):n||0!=(n=r&~e)&&(l=ex(n)),0===l?0:0!==t&&t!==l&&0==(t&a)&&((a=l&-l)>=(n=t&-t)||32===a&&0!=(4194048&n))?t:l}function eC(e,t){return 0==(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function e_(){var e=eS;return 0==(0x3c00000&(eS<<=1))&&(eS=4194304),e}function ez(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function eP(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function eN(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ey(t);e.entangledLanes|=t,e.entanglements[r]=0x40000000|e.entanglements[r]|261930&n}function eT(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ey(n),l=1<=nr),no=!1;function ni(e,t){switch(e){case\\"keyup\\":return -1!==nt.indexOf(t.keyCode);case\\"keydown\\":return 229!==t.keyCode;case\\"keypress\\":case\\"mousedown\\":case\\"focusout\\":return!0;default:return!1}}function nu(e){return\\"object\\"==typeof(e=e.detail)&&\\"data\\"in e?e.data:null}var ns=!1,nc={color:!0,date:!0,datetime:!0,\\"datetime-local\\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return\\"input\\"===t?!!nc[e.type]:\\"textarea\\"===t}function nd(e,t,n,r){tw?tS?tS.push(r):tS=[r]:tw=r,0<(t=sa(t,\\"onChange\\")).length&&(n=new tB(\\"onChange\\",\\"change\\",null,n,r),e.push({event:n,listeners:t}))}var np=null,nm=null;function nh(e){u5(e,0)}function ng(e){if(te(eK(e)))return e}function ny(e,t){if(\\"change\\"===e)return t}var nv=!1;if(tz){if(tz){var nb=\\"oninput\\"in document;if(!nb){var nk=document.createElement(\\"div\\");nk.setAttribute(\\"oninput\\",\\"return;\\"),nb=\\"function\\"==typeof nk.oninput}r=nb}else r=!1;nv=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nN(r)}}function nL(e){e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;for(var t=tt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=\\"string\\"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=tt(e.document)}return t}function nO(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(\\"input\\"===t&&(\\"text\\"===e.type||\\"search\\"===e.type||\\"tel\\"===e.type||\\"url\\"===e.type||\\"password\\"===e.type)||\\"textarea\\"===t||\\"true\\"===e.contentEditable)}var nD=tz&&\\"documentMode\\"in document&&11>=document.documentMode,nF=null,nR=null,nA=null,nM=!1;function nI(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;nM||null==nF||nF!==tt(r)||(r=\\"selectionStart\\"in(r=nF)&&nO(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},nA&&nP(nA,r)||(nA=r,0<(r=sa(nR,\\"onSelect\\")).length&&(t=new tB(\\"onSelect\\",\\"select\\",null,t,n),e.push({event:t,listeners:r}),t.target=nF)))}function nU(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[\\"Webkit\\"+e]=\\"webkit\\"+t,n[\\"Moz\\"+e]=\\"moz\\"+t,n}var n$={animationend:nU(\\"Animation\\",\\"AnimationEnd\\"),animationiteration:nU(\\"Animation\\",\\"AnimationIteration\\"),animationstart:nU(\\"Animation\\",\\"AnimationStart\\"),transitionrun:nU(\\"Transition\\",\\"TransitionRun\\"),transitionstart:nU(\\"Transition\\",\\"TransitionStart\\"),transitioncancel:nU(\\"Transition\\",\\"TransitionCancel\\"),transitionend:nU(\\"Transition\\",\\"TransitionEnd\\")},nj={},nH={};function nV(e){if(nj[e])return nj[e];if(!n$[e])return e;var t,n=n$[e];for(t in n)if(n.hasOwnProperty(t)&&t in nH)return nj[e]=n[t];return e}tz&&(nH=document.createElement(\\"div\\").style,\\"AnimationEvent\\"in window||(delete n$.animationend.animation,delete n$.animationiteration.animation,delete n$.animationstart.animation),\\"TransitionEvent\\"in window||delete n$.transitionend.transition);var nB=nV(\\"animationend\\"),nQ=nV(\\"animationiteration\\"),nW=nV(\\"animationstart\\"),nq=nV(\\"transitionrun\\"),nK=nV(\\"transitionstart\\"),nY=nV(\\"transitioncancel\\"),nG=nV(\\"transitionend\\"),nX=new Map,nZ=\\"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\\".split(\\" \\");function nJ(e,t){nX.set(e,t),eJ(t,[e])}nZ.push(\\"scrollEnd\\");var n0=\\"function\\"==typeof reportError?reportError:function(e){if(\\"object\\"==typeof window&&\\"function\\"==typeof window.ErrorEvent){var t=new window.ErrorEvent(\\"error\\",{bubbles:!0,cancelable:!0,message:\\"object\\"==typeof e&&null!==e&&\\"string\\"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(\\"object\\"==typeof l&&\\"function\\"==typeof l.emit)return void l.emit(\\"uncaughtException\\",e);console.error(e)},n1=[],n2=0,n3=0;function n4(){for(var e=n2,t=n3=n2=0;t>=o,l-=o,rk=1<<32-ey(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),rN&&rS(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),rN&&rS(l,g),c;if(null===h){for(;!v.done;g++,v=i.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return rN&&rS(l,g),c}for(h=r(h);!v.done;g++,v=i.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),rN&&rS(l,g),c}(s,c,f=b.call(f),h)}if(\\"function\\"==typeof f.then)return i(s,c,ly(f),h);if(f.$$typeof===S)return i(s,c,rX(s,f),h);lb(s,f)}return\\"string\\"==typeof f&&\\"\\"!==f||\\"number\\"==typeof f||\\"bigint\\"==typeof f?(f=\\"\\"+f,null!==c&&6===c.tag?(n(s,c.sibling),(h=l(c,f)).return=s):(n(s,c),(h=ru(f,s.mode,h)).return=s),o(s=h)):n(s,c)}(i,s,c,f);return lh=null,h}catch(e){if(e===la||e===li)throw e;var b=rn(29,e,null,i.mode);return b.lanes=f,b.return=i,b}finally{}}}var lw=lk(!0),lS=lk(!1),lx=!1;function lE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lC(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function l_(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lz(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&iI)){var l=r.pending;return null===l?t.next=t:(t.next=l.next,l.next=t),r.pending=t,t=n7(e),n9(e,null,n),t}return n8(e,r,t,n),n7(e)}function lP(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194048&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eT(e,n)}}function lN(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var l=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?l=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?l=a=t:a=a.next=t}else l=a=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var lT=!1;function lL(){if(lT){var e=r9;if(null!==e)throw e}}function lO(e,t,n,r){lT=!1;var l=e.updateQueue;lx=!1;var a=l.firstBaseUpdate,o=l.lastBaseUpdate,i=l.shared.pending;if(null!==i){l.shared.pending=null;var u=i,s=u.next;u.next=null,null===o?a=s:o.next=s,o=u;var c=e.alternate;null!==c&&(i=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===i?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=u)}if(null!==a){var f=l.baseState;for(o=0,c=s=u=null,i=a;;){var d=-0x20000001&i.lane,p=d!==i.lane;if(p?(ij&d)===d:(r&d)===d){0!==d&&d===r5&&(lT=!0),null!==c&&(c=c.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});e:{var h=e,g=i;switch(d=t,g.tag){case 1:if(\\"function\\"==typeof(h=g.payload)){f=h.call(n,f,d);break e}f=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(d=\\"function\\"==typeof(h=g.payload)?h.call(n,f,d):h))break e;f=m({},f,d);break e;case 2:lx=!0}}null!==(d=i.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=l.callbacks)?l.callbacks=[d]:p.push(d))}else p={lane:d,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===c?(s=c=p,u=f):c=c.next=p,o|=d;if(null===(i=i.next))if(null===(i=l.shared.pending))break;else i=(p=i).next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}null===c&&(u=f),l.baseState=u,l.firstBaseUpdate=s,l.lastBaseUpdate=c,null===a&&(l.shared.lanes=0),iY|=o,e.lanes=o,e.memoizedState=f}}function lD(e,t){if(\\"function\\"!=typeof e)throw Error(u(191,e));e.call(t)}function lF(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;ea?a:8;var o=F.T,i={};F.T=i,a7(e,!1,t,n);try{var u=l(),s=F.S;if(null!==s&&s(i,u),null!==u&&\\"object\\"==typeof u&&\\"function\\"==typeof u.then){var c,f,d=(c=[],f={status:\\"pending\\",value:null,reason:null,then:function(e){c.push(e)}},u.then(function(){f.status=\\"fulfilled\\",f.value=r;for(var e=0;e title\\"))),sm(a,r,n),a[eM]=e,eG(a),r=a;break e;case\\"link\\":var o=s4(\\"link\\",\\"href\\",l).get(r+(n.href||\\"\\"));if(o){for(var i=0;ii)break;var c=u.transferSize,f=u.initiatorType;c&&sh(f)&&(o+=c*((u=u.responseEnd)s5?50:800)+h);return m.unsuspend=e,function(){m.unsuspend=null,clearTimeout(t),clearTimeout(n)}}:null)){ut=a,e.cancelPendingCommit=g(uz.bind(null,e,t,a,n,r,l,o,i,u,c,f,null,d,p)),ud(e,a,o,!s);return}}uz(e,t,a,n,r,l,o,i,u)}function ud(e,t,n,r){t&=~iX,t&=~iG,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var l=t;0<\\\\/script>\\",a=a.removeChild(a.firstChild);break;case\\"select\\":a=\\"string\\"==typeof r.is?o.createElement(\\"select\\",{is:r.is}):o.createElement(\\"select\\"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=\\"string\\"==typeof r.is?o.createElement(l,{is:r.is}):o.createElement(l)}}a[eM]=t,a[eI]=r;e:for(o=t.child;null!==o;){if(5===o.tag||6===o.tag)a.appendChild(o.stateNode);else if(4!==o.tag&&27!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(t.stateNode=a,sm(a,l,r),l){case\\"button\\":case\\"input\\":case\\"select\\":case\\"textarea\\":r=!!r.autoFocus;break;case\\"img\\":r=!0;break;default:r=!1}r&&oY(t)}}return o0(t),oG(t,t.type,null===e?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&oY(t);else{if(\\"string\\"!=typeof r&&null===t.stateNode)throw Error(u(166));if(e=B.current,rA(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(l=rz))switch(l.tag){case 27:case 5:r=l.memoizedProps}e[eM]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||sf(e.nodeValue,n)))||rD(t,!0)}else(e=sv(e).createTextNode(r))[eM]=t,t.stateNode=e}return o0(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=rA(t),null!==n){if(null===e){if(!r)throw Error(u(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(u(557));e[eM]=t}else rM(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;o0(t),e=!1}else n=rI(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e){if(256&t.flags)return lW(t),t;return lW(t),null}if(0!=(128&t.flags))throw Error(u(558))}return o0(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(l=rA(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(u(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(u(317));l[eM]=t}else rM(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;o0(t),l=!1}else l=rI(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l){if(256&t.flags)return lW(t),t;return lW(t),null}}if(lW(t),0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),oZ(t,t.updateQueue),o0(t),null;case 4:return q(),null===e&&st(t.stateNode.containerInfo),o0(t),null;case 10:return rB(t.type),o0(t),null;case 19:if($(lq),null===(r=t.memoizedState))return o0(t),null;if(l=0!=(128&t.flags),null===(a=r.rendering))if(l)oJ(r,!1);else{if(0!==iK||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=lK(e))){for(t.flags|=128,oJ(r,!1),t.updateQueue=e=a.updateQueue,oZ(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)ra(n,e),n=n.sibling;return j(lq,1&lq.current|2),rN&&rS(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ea()>i8&&(t.flags|=128,l=!0,oJ(r,!1),t.lanes=4194304)}else{if(!l)if(null!==(e=lK(a))){if(t.flags|=128,l=!0,t.updateQueue=e=e.updateQueue,oZ(t,e),oJ(r,!0),null===r.tail&&\\"hidden\\"===r.tailMode&&!a.alternate&&!rN)return o0(t),null}else 2*ea()-r.renderingStartTime>i8&&0x20000000!==n&&(t.flags|=128,l=!0,oJ(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=r.last)?e.sibling=a:t.child=a,r.last=a)}if(null!==r.tail)return e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ea(),e.sibling=null,n=lq.current,j(lq,l?1&n|2:1&n),rN&&rS(t,r.treeForkCount),e;return o0(t),null;case 22:case 23:return lW(t),lU(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!=(0x20000000&n)&&0==(128&t.flags)&&(o0(t),6&t.subtreeFlags&&(t.flags|=8192)):o0(t),null!==(n=t.updateQueue)&&oZ(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&$(lt),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),rB(r2),o0(t),null;case 25:case 30:return null}throw Error(u(156,t.tag))}(t.alternate,t,iq);if(null!==n){i$=n;return}if(null!==(t=t.sibling)){i$=t;return}i$=t=e}while(null!==t);0===iK&&(iK=5)}function u_(e,t){do{var n=function(e,t){switch(rC(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return rB(r2),q(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Y(t),null;case 31:if(null!==t.memoizedState){if(lW(t),null===t.alternate)throw Error(u(340));rM()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(lW(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(u(340));rM()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return $(lq),null;case 4:return q(),null;case 10:return rB(t.type),null;case 22:case 23:return lW(t),lU(),null!==e&&$(lt),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return rB(r2),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,i$=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){i$=e;return}i$=e=n}while(null!==e);iK=6,i$=null}function uz(e,t,n,r,l,a,o,i,s){e.cancelPendingCommit=null;do uO();while(0!==i9);if(0!=(6&iI))throw Error(u(327));if(null!==t){if(t===e.current)throw Error(u(177));if(!function(e,t,n,r,l,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var i=e.entanglements,u=e.expirationTimes,s=e.hiddenUpdates;for(n=o&~n;0g&&(o=g,g=h,h=o);var y=nT(i,h),v=nT(i,g);if(y&&v&&(1!==p.rangeCount||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var b=f.createRange();b.setStart(y.node,y.offset),p.removeAllRanges(),h>g?(p.addRange(b),p.extend(v.node,v.offset)):(b.setEnd(v.node,v.offset),p.addRange(b))}}}}for(f=[],p=i;p=p.parentNode;)1===p.nodeType&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(\\"function\\"==typeof i.focus&&i.focus(),i=0;in?32:n,F.T=null,n=ur,ur=null;var a=i7,o=ut;if(i9=0,ue=i7=null,ut=0,0!=(6&iI))throw Error(u(331));var i=iI;if(iI|=4,iF(a.current),iz(a,a.current,o,n),iI=i,uK(0,!1),eh&&\\"function\\"==typeof eh.onPostCommitFiberRoot)try{eh.onPostCommitFiberRoot(em,a)}catch(e){}return!0}finally{R.p=l,F.T=r,uL(e,t)}}function uF(e,t,n){t=rd(n,t),t=oy(e.stateNode,t,2),null!==(e=lz(e,t,2))&&(eP(e,2),uq(e))}function uR(e,t,n){if(3===e.tag)uF(e,e,n);else for(;null!==t;){if(3===t.tag){uF(t,e,n);break}if(1===t.tag){var r=t.stateNode;if(\\"function\\"==typeof t.type.getDerivedStateFromError||\\"function\\"==typeof r.componentDidCatch&&(null===i5||!i5.has(r))){e=rd(n,e),null!==(r=lz(t,n=ov(2),2))&&(ob(n,r,t,e),eP(r,2),uq(r));break}}t=t.return}}function uA(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new iM;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(iW=!0,l.add(n),e=uM.bind(null,e,t,n),t.then(e,e))}function uM(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,iU===e&&(ij&n)===n&&(4===iK||3===iK&&(0x3c00000&ij)===ij&&300>ea()-i3?0==(2&iI)&&uh(e,0):iX|=n,iJ===ij&&(iJ=0)),uq(e)}function uI(e,t){0===t&&(t=e_()),null!==(e=n5(e,t))&&(eP(e,t),uq(e))}function uU(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),uI(e,n)}function u$(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(u(314))}null!==r&&r.delete(t),uI(e,n)}var uj=null,uH=null,uV=!1,uB=!1,uQ=!1,uW=0;function uq(e){e!==uH&&null===e.next&&(null===uH?uj=uH=e:uH=uH.next=e),uB=!0,uV||(uV=!0,s_(function(){0!=(6&iI)?et(ei,uY):uG()}))}function uK(e,t){if(!uQ&&uB){uQ=!0;do for(var n=!1,r=uj;null!==r;){if(!t)if(0!==e){var l=r.pendingLanes;if(0===l)var a=0;else{var o=r.suspendedLanes,i=r.pingedLanes;a=0xc000095&(a=(1<<31-ey(42|e)+1)-1&(l&~(o&~i)))?0xc000095&a|1:a?2|a:0}0!==a&&(n=!0,uJ(r,a))}else a=ij,0==(3&(a=eE(r,r===iU?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||eC(r,a)||(n=!0,uJ(r,a));r=r.next}while(n);uQ=!1}}function uY(){uG()}function uG(){uB=uV=!1;var e,t=0;0===uW||((e=window.event)&&\\"popstate\\"===e.type?e===sS||(sS=e,0):(sS=null,1))||(t=uW);for(var n=ea(),r=null,l=uj;null!==l;){var a=l.next,o=uX(l,n);0===o?(l.next=null,null===r?uj=a:r.next=a,null===a&&(uH=r)):(r=l,(0!==t||0!=(3&o))&&(uB=!0)),l=a}0!==i9&&5!==i9||uK(t,!1),0!==uW&&(uW=0)}function uX(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=-0x3c00001&e.pendingLanes;0 title\\"):null)}function s6(e){return\\"stylesheet\\"!==e.type||0!=(3&e.state.loading)}var s5=0;function s9(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages)){if(this.stylesheets)ce(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var s7=null;function ce(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,s7=new Map,t.forEach(ct,e),s7=null,s9.call(e))}function ct(e,t){if(!(4&t.state.loading)){var n=s7.get(e);if(n)var r=n.get(null);else{n=new Map,s7.set(e,n);for(var l=e.querySelectorAll(\\"link[data-precedence],style[data-precedence]\\"),a=0;a{var r=n(4232);function l(e){var t=\\"https://react.dev/errors/\\"+e;if(1{function n(e,t){var n=e.length;for(e.push(t);0>>1,l=e[r];if(0>>1;ra(u,n))sa(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[i]=n,r=i);else if(sa(c,n))e[r]=c,e[s]=n,r=s;else break}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,\\"object\\"==typeof performance&&\\"function\\"==typeof performance.now){var o,i=performance;t.unstable_now=function(){return i.now()}}else{var u=Date,s=u.now();t.unstable_now=function(){return u.now()-s}}var c=[],f=[],d=1,p=null,m=3,h=!1,g=!1,y=!1,v=!1,b=\\"function\\"==typeof setTimeout?setTimeout:null,k=\\"function\\"==typeof clearTimeout?clearTimeout:null,w=\\"undefined\\"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(f);null!==t;){if(null===t.callback)l(f);else if(t.startTime<=e)l(f),t.sortIndex=t.expirationTime,n(c,t);else break;t=r(f)}}function x(e){if(y=!1,S(e),!g)if(null!==r(c))g=!0,E||(E=!0,o());else{var t=r(f);null!==t&&O(x,t.startTime-e)}}var E=!1,C=-1,_=5,z=-1;function P(){return!!v||!(t.unstable_now()-z<_)}function N(){if(v=!1,E){var e=t.unstable_now();z=e;var n=!0;try{e:{g=!1,y&&(y=!1,k(C),C=-1),h=!0;var a=m;try{t:{for(S(e),p=r(c);null!==p&&!(p.expirationTime>e&&P());){var i=p.callback;if(\\"function\\"==typeof i){p.callback=null,m=p.priorityLevel;var u=i(p.expirationTime<=e);if(e=t.unstable_now(),\\"function\\"==typeof u){p.callback=u,S(e),n=!0;break t}p===r(c)&&l(c),S(e)}else l(c);p=r(c)}if(null!==p)n=!0;else{var s=r(f);null!==s&&O(x,s.startTime-e),n=!1}}break e}finally{p=null,m=a,h=!1}}}finally{n?o():E=!1}}}if(\\"function\\"==typeof w)o=function(){w(N)};else if(\\"undefined\\"!=typeof MessageChannel){var T=new MessageChannel,L=T.port2;T.port1.onmessage=N,o=function(){L.postMessage(null)}}else o=function(){b(N,0)};function O(e,n){C=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125i?(e.sortIndex=a,n(f,e),null===r(c)&&e===r(f)&&(y?(k(C),C=-1):y=!0,O(x,a-i))):(e.sortIndex=u,n(c,e),g||h||(g=!0,E||(E=!0,o()))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},7876:(e,t,n)=>{e.exports=n(8228)},8228:(e,t)=>{var n=Symbol.for(\\"react.transitional.element\\");function r(e,t,r){var l=null;if(void 0!==r&&(l=\\"\\"+r),void 0!==t.key&&(l=\\"\\"+t.key),\\"key\\"in t)for(var a in r={},t)\\"key\\"!==a&&(r[a]=t[a]);else r=t;return{$$typeof:n,type:e,key:l,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for(\\"react.fragment\\"),t.jsx=r,t.jsxs=r},8477:(e,t,n)=>{!function e(){if(\\"undefined\\"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&\\"function\\"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(4655)},8944:(e,t,n)=>{!function e(){if(\\"undefined\\"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&\\"function\\"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(4279)}}]);"},{"name":"main-adb980b01965416d.js","path":"apps/web/out/_next/static/chunks/main-adb980b01965416d.js","area":"FRONTEND","folder":"CHUNKS","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[792],{39:(e,t)=>{\\"use strict\\";function r(e){return e.split(\\"/\\").map(e=>encodeURIComponent(e)).join(\\"/\\")}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"encodeURIPath\\",{enumerable:!0,get:function(){return r}})},53:(e,t)=>{\\"use strict\\";function r(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),r}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"omit\\",{enumerable:!0,get:function(){return r}})},495:(e,t)=>{\\"use strict\\";function r(e){return e.replace(/\\\\/$/,\\"\\")||\\"/\\"}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"removeTrailingSlash\\",{enumerable:!0,get:function(){return r}})},682:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={normalizeAppPath:function(){return u},normalizeRscURL:function(){return s}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6231),i=r(9853);function u(e){return(0,o.ensureLeadingSlash)(e.split(\\"/\\").reduce((e,t,r,n)=>!t||(0,i.isGroupSegment)(t)||\\"@\\"===t[0]||(\\"page\\"===t||\\"route\\"===t)&&r===n.length-1?e:`${e}/${t}`,\\"\\"))}function s(e){return e.replace(/\\\\.rsc($|\\\\?)/,\\"$1\\")}},760:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={NavigationPromisesContext:function(){return l},PathParamsContext:function(){return s},PathnameContext:function(){return u},SearchParamsContext:function(){return i},createDevToolsInstrumentedPromise:function(){return c}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4232),i=(0,o.createContext)(null),u=(0,o.createContext)(null),s=(0,o.createContext)(null),l=(0,o.createContext)(null);function c(e,t){let r=Promise.resolve(t);return r.status=\\"fulfilled\\",r.value=t,r.displayName=`${e} (SSR)`,r}},807:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"Portal\\",{enumerable:!0,get:function(){return o}});let n=r(4232),a=r(8477),o=({children:e,type:t})=>{let[r,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=document.createElement(t);return document.body.appendChild(e),o(e),()=>{document.body.removeChild(e)}},[t]),r?(0,a.createPortal)(e,r):null};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},888:(e,t)=>{\\"use strict\\";function r(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=r.length;n--;){let a=r[n];if(\\"query\\"===a){let r=Object.keys(e.query);if(r.length!==Object.keys(t.query).length)return!1;for(let n=r.length;n--;){let a=r[n];if(!t.query.hasOwnProperty(a)||e.query[a]!==t.query[a])return!1}}else if(!t.hasOwnProperty(a)||e[a]!==t[a])return!1}return!0}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"compareRouterStates\\",{enumerable:!0,get:function(){return r}})},921:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"pathHasPrefix\\",{enumerable:!0,get:function(){return a}});let n=r(4625);function a(e,t){if(\\"string\\"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+\\"/\\")}},946:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={VALID_LOADERS:function(){return a},imageConfigDefault:function(){return o}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=[\\"default\\",\\"imgix\\",\\"cloudinary\\",\\"akamai\\",\\"custom\\"],o={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:\\"/_next/image\\",loader:\\"default\\",loaderFile:\\"\\",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:[\\"image/webp\\"],maximumRedirects:3,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:\\"script-src \'none\'; frame-src \'none\'; sandbox;\\",contentDispositionType:\\"attachment\\",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},970:(e,t)=>{\\"use strict\\";function r(e){return new URL(e,\\"http://n\\").searchParams}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"asPathToSearchParams\\",{enumerable:!0,get:function(){return r}})},1162:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"addLocale\\",{enumerable:!0,get:function(){return n}}),r(6720);let n=(e,...t)=>e;(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1291:()=>{\\"trimStart\\"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),\\"trimEnd\\"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),\\"description\\"in Symbol.prototype||Object.defineProperty(Symbol.prototype,\\"description\\",{configurable:!0,get:function(){var e=/\\\\((.*)\\\\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if(\\"function\\"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError(\\"Cannot convert undefined or null to object\\");return Object.prototype.hasOwnProperty.call(Object(e),t)}),\\"canParse\\"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},1407:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"InvariantError\\",{enumerable:!0,get:function(){return r}});class r extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(\\".\\")?e:e+\\".\\"} This is a bug in Next.js.`,t),this.name=\\"InvariantError\\"}}},1450:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={getSortedRouteObjects:function(){return i},getSortedRoutes:function(){return o}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});class a{insert(e){this._insert(e.split(\\"/\\").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e=\\"/\\"){let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf(\\"[]\\"),1),null!==this.restSlugName&&t.splice(t.indexOf(\\"[...]\\"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf(\\"[[...]]\\"),1);let r=t.map(t=>this.children.get(t)._smoosh(`${e}${t}/`)).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get(\\"[]\\")._smoosh(`${e}[${this.slugName}]/`)),!this.placeholder){let t=\\"/\\"===e?\\"/\\":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error(`You cannot define a route with the same specificity as a optional catch-all route (\\"${t}\\" and \\"${t}[[...${this.optionalRestSlugName}]]\\").`),\\"__NEXT_ERROR_CODE\\",{value:\\"E458\\",enumerable:!1,configurable:!0});r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get(\\"[...]\\")._smoosh(`${e}[...${this.restSlugName}]/`)),null!==this.optionalRestSlugName&&r.push(...this.children.get(\\"[[...]]\\")._smoosh(`${e}[[...${this.optionalRestSlugName}]]/`)),r}_insert(e,t,r){if(0===e.length){this.placeholder=!1;return}if(r)throw Object.defineProperty(Error(\\"Catch-all must be the last part of the URL.\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E392\\",enumerable:!1,configurable:!0});let n=e[0];if(n.startsWith(\\"[\\")&&n.endsWith(\\"]\\")){let a=n.slice(1,-1),i=!1;if(a.startsWith(\\"[\\")&&a.endsWith(\\"]\\")&&(a=a.slice(1,-1),i=!0),a.startsWith(\\"…\\"))throw Object.defineProperty(Error(`Detected a three-dot character (\'…\') at (\'${a}\'). Did you mean (\'...\')?`),\\"__NEXT_ERROR_CODE\\",{value:\\"E147\\",enumerable:!1,configurable:!0});if(a.startsWith(\\"...\\")&&(a=a.substring(3),r=!0),a.startsWith(\\"[\\")||a.endsWith(\\"]\\"))throw Object.defineProperty(Error(`Segment names may not start or end with extra brackets (\'${a}\').`),\\"__NEXT_ERROR_CODE\\",{value:\\"E421\\",enumerable:!1,configurable:!0});if(a.startsWith(\\".\\"))throw Object.defineProperty(Error(`Segment names may not start with erroneous periods (\'${a}\').`),\\"__NEXT_ERROR_CODE\\",{value:\\"E288\\",enumerable:!1,configurable:!0});function o(e,r){if(null!==e&&e!==r)throw Object.defineProperty(Error(`You cannot use different slug names for the same dynamic path (\'${e}\' !== \'${r}\').`),\\"__NEXT_ERROR_CODE\\",{value:\\"E337\\",enumerable:!1,configurable:!0});t.forEach(e=>{if(e===r)throw Object.defineProperty(Error(`You cannot have the same slug name \\"${r}\\" repeat within a single dynamic path`),\\"__NEXT_ERROR_CODE\\",{value:\\"E247\\",enumerable:!1,configurable:!0});if(e.replace(/\\\\W/g,\\"\\")===n.replace(/\\\\W/g,\\"\\"))throw Object.defineProperty(Error(`You cannot have the slug names \\"${e}\\" and \\"${r}\\" differ only by non-word symbols within a single dynamic path`),\\"__NEXT_ERROR_CODE\\",{value:\\"E499\\",enumerable:!1,configurable:!0})}),t.push(r)}if(r)if(i){if(null!=this.restSlugName)throw Object.defineProperty(Error(`You cannot use both an required and optional catch-all route at the same level (\\"[...${this.restSlugName}]\\" and \\"${e[0]}\\" ).`),\\"__NEXT_ERROR_CODE\\",{value:\\"E299\\",enumerable:!1,configurable:!0});o(this.optionalRestSlugName,a),this.optionalRestSlugName=a,n=\\"[[...]]\\"}else{if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error(`You cannot use both an optional and required catch-all route at the same level (\\"[[...${this.optionalRestSlugName}]]\\" and \\"${e[0]}\\").`),\\"__NEXT_ERROR_CODE\\",{value:\\"E300\\",enumerable:!1,configurable:!0});o(this.restSlugName,a),this.restSlugName=a,n=\\"[...]\\"}else{if(i)throw Object.defineProperty(Error(`Optional route parameters are not yet supported (\\"${e[0]}\\").`),\\"__NEXT_ERROR_CODE\\",{value:\\"E435\\",enumerable:!1,configurable:!0});o(this.slugName,a),this.slugName=a,n=\\"[]\\"}}this.children.has(n)||this.children.set(n,new a),this.children.get(n)._insert(e.slice(1),t,r)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function o(e){let t=new a;return e.forEach(e=>t.insert(e)),t.smoosh()}function i(e,t){let r={},n=[];for(let a=0;ae[r[t]])}},1577:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={assign:function(){return u},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return i}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function o(e){return\\"string\\"==typeof e?e:(\\"number\\"!=typeof e||isNaN(e))&&\\"boolean\\"!=typeof e?\\"\\":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,o(e));else t.set(r,o(n));return t}function u(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},1579:e=>{\\"use strict\\";e.exports=[\\"chrome 111\\",\\"edge 111\\",\\"firefox 111\\",\\"safari 16.4\\"]},1591:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={getNamedMiddlewareRegex:function(){return _},getNamedRouteRegex:function(){return h},getRouteRegex:function(){return f}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(9308),i=r(5173),u=r(4111),s=r(495),l=r(7300);function c(e,t,r){let n={},a=1,o=[];for(let c of(0,s.removeTrailingSlash)(e).slice(1).split(\\"/\\")){let e=i.INTERCEPTION_ROUTE_MARKERS.find(e=>c.startsWith(e)),s=c.match(l.PARAMETER_PATTERN);if(e&&s&&s[2]){let{key:t,optional:r,repeat:i}=(0,l.parseMatchedParameter)(s[2]);n[t]={pos:a++,repeat:i,optional:r},o.push(`/${(0,u.escapeStringRegexp)(e)}([^/]+?)`)}else if(s&&s[2]){let{key:e,repeat:t,optional:i}=(0,l.parseMatchedParameter)(s[2]);n[e]={pos:a++,repeat:t,optional:i},r&&s[1]&&o.push(`/${(0,u.escapeStringRegexp)(s[1])}`);let c=t?i?\\"(?:/(.+?))?\\":\\"/(.+?)\\":\\"/([^/]+?)\\";r&&s[1]&&(c=c.substring(1)),o.push(c)}else o.push(`/${(0,u.escapeStringRegexp)(c)}`);t&&s&&s[3]&&o.push((0,u.escapeStringRegexp)(s[3]))}return{parameterizedRoute:o.join(\\"\\"),groups:n}}function f(e,{includeSuffix:t=!1,includePrefix:r=!1,excludeOptionalTrailingSlash:n=!1}={}){let{parameterizedRoute:a,groups:o}=c(e,t,r),i=a;return n||(i+=\\"(?:/)?\\"),{re:RegExp(`^${i}$`),groups:o}}function d({interceptionMarker:e,getSafeRouteKey:t,segment:r,routeKeys:n,keyPrefix:a,backreferenceDuplicateKeys:o}){let i,{key:s,optional:c,repeat:f}=(0,l.parseMatchedParameter)(r),d=s.replace(/\\\\W/g,\\"\\");a&&(d=`${a}${d}`);let p=!1;(0===d.length||d.length>30)&&(p=!0),isNaN(parseInt(d.slice(0,1)))||(p=!0),p&&(d=t());let h=d in n;a?n[d]=`${a}${s}`:n[d]=s;let _=e?(0,u.escapeStringRegexp)(e):\\"\\";return i=h&&o?`\\\\\\\\k<${d}>`:f?`(?<${d}>.+?)`:`(?<${d}>[^/]+?)`,{key:s,pattern:c?`(?:/${_}${i})?`:`/${_}${i}`,cleanedKey:d,optional:c,repeat:f}}function p(e,t,r,n,a,c={names:{},intercepted:{}}){let f,h=(f=0,()=>{let e=\\"\\",t=++f;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),_={},m=[],g=[];for(let f of(c=structuredClone(c),(0,s.removeTrailingSlash)(e).slice(1).split(\\"/\\"))){let e,s=i.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)),p=f.match(l.PARAMETER_PATTERN),E=s?p?.[1]:void 0;if(E&&p?.[2]?(e=t?o.NEXT_INTERCEPTION_MARKER_PREFIX:void 0,c.intercepted[p[2]]=E):e=p?.[2]&&c.intercepted[p[2]]?t?o.NEXT_INTERCEPTION_MARKER_PREFIX:void 0:t?o.NEXT_QUERY_PARAM_PREFIX:void 0,E&&p&&p[2]){let{key:t,pattern:r,cleanedKey:n,repeat:o,optional:i}=d({getSafeRouteKey:h,interceptionMarker:E,segment:p[2],routeKeys:_,keyPrefix:e,backreferenceDuplicateKeys:a});m.push(r),g.push(`/${p[1]}:${c.names[t]??n}${o?i?\\"*\\":\\"+\\":\\"\\"}`),c.names[t]??=n}else if(p&&p[2]){n&&p[1]&&(m.push(`/${(0,u.escapeStringRegexp)(p[1])}`),g.push(`/${p[1]}`));let{key:t,pattern:r,cleanedKey:o,repeat:i,optional:s}=d({getSafeRouteKey:h,segment:p[2],routeKeys:_,keyPrefix:e,backreferenceDuplicateKeys:a}),l=r;n&&p[1]&&(l=l.substring(1)),m.push(l),g.push(`/:${c.names[t]??o}${i?s?\\"*\\":\\"+\\":\\"\\"}`),c.names[t]??=o}else m.push(`/${(0,u.escapeStringRegexp)(f)}`),g.push(`/${f}`);r&&p&&p[3]&&(m.push((0,u.escapeStringRegexp)(p[3])),g.push(p[3]))}return{namedParameterizedRoute:m.join(\\"\\"),routeKeys:_,pathToRegexpPattern:g.join(\\"\\"),reference:c}}function h(e,t){let r=p(e,t.prefixRouteKeys,t.includeSuffix??!1,t.includePrefix??!1,t.backreferenceDuplicateKeys??!1,t.reference),n=r.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(n+=\\"(?:/)?\\"),{...f(e,t),namedRegex:`^${n}$`,routeKeys:r.routeKeys,pathToRegexpPattern:r.pathToRegexpPattern,reference:r.reference}}function _(e,t){let{parameterizedRoute:r}=c(e,!1,!1),{catchAll:n=!0}=t;if(\\"/\\"===r)return{namedRegex:`^/${n?\\".*\\":\\"\\"}$`};let{namedParameterizedRoute:a}=p(e,!1,!1,!1,!1,void 0);return{namedRegex:`^${a}${n?\\"(?:(/.*)?)\\":\\"\\"}$`}}},1699:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={createKey:function(){return q},default:function(){return V},matchesMiddleware:function(){return $}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4252),i=r(8365),u=r(495),s=r(8945),l=r(3209),c=i._(r(6240)),f=r(7796),d=r(3775),p=o._(r(9046)),h=r(9313),_=r(7380),m=r(4482),g=r(5042),E=r(1591),y=r(7855);r(3773);let P=r(4625),b=r(1162),R=r(7687),v=r(8260),O=r(3467),S=r(9348),T=r(5948),A=r(2326),j=r(7064),N=r(6873),w=r(888),C=r(2454),I=r(8452),x=r(53),M=r(8918),L=r(5481),D=r(9308);function U(){return Object.assign(Object.defineProperty(Error(\\"Route Cancelled\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E315\\",enumerable:!1,configurable:!0}),{cancelled:!0})}async function $(e){let t=await Promise.resolve(e.router.pageLoader.getMiddleware());if(!t)return!1;let{pathname:r}=(0,P.parsePath)(e.asPath),n=(0,S.hasBasePath)(r)?(0,v.removeBasePath)(r):r,a=(0,O.addBasePath)((0,b.addLocale)(n,e.locale));return t.some(e=>new RegExp(e.regexp).test(a))}function F(e){let t=(0,h.getLocationOrigin)();return e.startsWith(t)?e.substring(t.length):e}function k(e,t,r){let[n,a]=(0,T.resolveHref)(e,t,!0),o=(0,h.getLocationOrigin)(),i=n.startsWith(o),u=a&&a.startsWith(o);n=F(n),a=a?F(a):a;let s=i?n:(0,O.addBasePath)(n),l=r?F((0,T.resolveHref)(e,r)):a||n;return{url:s,as:u?l:(0,O.addBasePath)(l)}}function B(e,t){let r=(0,u.removeTrailingSlash)((0,f.denormalizePagePath)(e));return\\"/404\\"===r||\\"/_error\\"===r?e:(t.includes(r)||t.some(t=>{if((0,_.isDynamicRoute)(t)&&(0,E.getRouteRegex)(t).re.test(r))return e=t,!0}),(0,u.removeTrailingSlash)(e))}async function H(e){if(!await $(e)||!e.fetchData)return null;let t=await e.fetchData(),r=await function(e,t,r){let n={basePath:r.router.basePath,i18n:{locales:r.router.locales},trailingSlash:!1},a=t.headers.get(\\"x-nextjs-rewrite\\"),o=a||t.headers.get(\\"x-nextjs-matched-path\\"),i=t.headers.get(D.MATCHED_PATH_HEADER);if(!i||o||i.includes(\\"__next_data_catchall\\")||i.includes(\\"/_error\\")||i.includes(\\"/404\\")||(o=i),o){if(o.startsWith(\\"/\\")){let t=(0,m.parseRelativeUrl)(o),i=(0,j.getNextPathnameInfo)(t.pathname,{nextConfig:n,parseData:!0}),l=(0,u.removeTrailingSlash)(i.pathname);return Promise.all([r.router.pageLoader.getPageList(),(0,s.getClientBuildManifest)()]).then(([o,{__rewrites:u}])=>{let s=(0,b.addLocale)(i.pathname,i.locale);if((0,_.isDynamicRoute)(s)||!a&&o.includes((0,d.normalizeLocalePath)((0,v.removeBasePath)(s),r.router.locales).pathname)){let r=(0,j.getNextPathnameInfo)((0,m.parseRelativeUrl)(e).pathname,{nextConfig:n,parseData:!0});t.pathname=s=(0,O.addBasePath)(r.pathname)}if(!o.includes(l)){let e=B(l,o);e!==l&&(l=e)}let c=o.includes(l)?l:B((0,d.normalizeLocalePath)((0,v.removeBasePath)(t.pathname),r.router.locales).pathname,o);if((0,_.isDynamicRoute)(c)){let e=(0,g.getRouteMatcher)((0,E.getRouteRegex)(c))(s);Object.assign(t.query,e||{})}return{type:\\"rewrite\\",parsedAs:t,resolvedHref:c}})}let t=(0,P.parsePath)(e),i=(0,N.formatNextPathnameInfo)({...(0,j.getNextPathnameInfo)(t.pathname,{nextConfig:n,parseData:!0}),defaultLocale:r.router.defaultLocale,buildId:\\"\\"});return Promise.resolve({type:\\"redirect-external\\",destination:`${i}${t.query}${t.hash}`})}let l=t.headers.get(\\"x-nextjs-redirect\\");if(l){if(l.startsWith(\\"/\\")){let e=(0,P.parsePath)(l),t=(0,N.formatNextPathnameInfo)({...(0,j.getNextPathnameInfo)(e.pathname,{nextConfig:n,parseData:!0}),defaultLocale:r.router.defaultLocale,buildId:\\"\\"});return Promise.resolve({type:\\"redirect-internal\\",newAs:`${t}${e.query}${e.hash}`,newUrl:`${t}${e.query}${e.hash}`})}return Promise.resolve({type:\\"redirect-external\\",destination:l})}return Promise.resolve({type:\\"next\\"})}(t.dataHref,t.response,e);return{dataHref:t.dataHref,json:t.json,response:t.response,text:t.text,cacheKey:t.cacheKey,effect:r}}let X=Symbol(\\"SSG_DATA_NOT_FOUND\\");function W(e){try{return JSON.parse(e)}catch(e){return null}}function G({dataHref:e,inflightCache:t,isPrefetch:r,hasMiddleware:n,isServerRender:a,parseJSON:o,persistCache:i,isBackground:u,unstable_skipClientCache:l}){let{href:c}=new URL(e,window.location.href),f=u=>(function e(t,r,n){return fetch(t,{credentials:\\"same-origin\\",method:n.method||\\"GET\\",headers:Object.assign({},n.headers,{\\"x-nextjs-data\\":\\"1\\"})}).then(a=>!a.ok&&r>1&&a.status>=500?e(t,r-1,n):a)})(e,a?3:1,{headers:Object.assign({},r?{purpose:\\"prefetch\\"}:{},r&&n?{\\"x-middleware-prefetch\\":\\"1\\"}:{},{}),method:u?.method??\\"GET\\"}).then(t=>t.ok&&u?.method===\\"HEAD\\"?{dataHref:e,response:t,text:\\"\\",json:{},cacheKey:c}:t.text().then(r=>{if(!t.ok){if(n&&[301,302,307,308].includes(t.status))return{dataHref:e,response:t,text:r,json:{},cacheKey:c};if(404===t.status&&W(r)?.notFound)return{dataHref:e,json:{notFound:X},response:t,text:r,cacheKey:c};let o=Object.defineProperty(Error(\\"Failed to load static props\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E124\\",enumerable:!1,configurable:!0});throw a||(0,s.markAssetError)(o),o}return{dataHref:e,json:o?W(r):null,response:t,text:r,cacheKey:c}})).then(e=>(i&&\\"no-cache\\"!==e.response.headers.get(\\"x-middleware-cache\\")||delete t[c],e)).catch(e=>{throw l||delete t[c],(\\"Failed to fetch\\"===e.message||\\"NetworkError when attempting to fetch resource.\\"===e.message||\\"Load failed\\"===e.message)&&(0,s.markAssetError)(e),e});return l&&i?f({}).then(e=>(\\"no-cache\\"!==e.response.headers.get(\\"x-middleware-cache\\")&&(t[c]=Promise.resolve(e)),e)):void 0!==t[c]?t[c]:t[c]=f(u?{method:\\"HEAD\\"}:{})}function q(){return Math.random().toString(36).slice(2,10)}function z({url:e,router:t}){if(e===(0,O.addBasePath)((0,b.addLocale)(t.asPath,t.locale)))throw Object.defineProperty(Error(`Invariant: attempted to hard navigate to the same URL ${e} ${location.href}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E282\\",enumerable:!1,configurable:!0});window.location.href=e}let Y=({route:e,router:t})=>{let r=!1,n=t.clc=()=>{r=!0};return()=>{if(r){let t=Object.defineProperty(Error(`Abort fetching component for route: \\"${e}\\"`),\\"__NEXT_ERROR_CODE\\",{value:\\"E483\\",enumerable:!1,configurable:!0});throw t.cancelled=!0,t}n===t.clc&&(t.clc=null)}};class V{static{this.events=(0,p.default)()}constructor(e,t,r,{initialProps:n,pageLoader:a,App:o,wrapApp:i,Component:s,err:l,subscription:c,isFallback:f,locale:d,locales:p,defaultLocale:g,domainLocales:E,isPreview:P}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=q(),this.onPopState=e=>{let t,{isFirstPopStateEvent:r}=this;this.isFirstPopStateEvent=!1;let n=e.state;if(!n){let{pathname:e,query:t}=this;this.changeState(\\"replaceState\\",(0,y.formatWithValidation)({pathname:(0,O.addBasePath)(e),query:t}),(0,h.getURL)());return}if(n.__NA)return void window.location.reload();if(!n.__N||r&&this.locale===n.options.locale&&n.as===this.asPath)return;let{url:a,as:o,options:i,key:u}=n;this._key=u;let{pathname:s}=(0,m.parseRelativeUrl)(a);this.isSsr&&o===(0,O.addBasePath)(this.asPath)&&s===(0,O.addBasePath)(this.pathname)||(!this._bps||this._bps(n))&&this.change(\\"replaceState\\",a,o,Object.assign({},i,{shallow:i.shallow&&this._shallow,locale:i.locale||this.defaultLocale,_h:0}),t)};const b=(0,u.removeTrailingSlash)(e);this.components={},\\"/_error\\"!==e&&(this.components[b]={Component:s,initial:!0,props:n,err:l,__N_SSG:n&&n.__N_SSG,__N_SSP:n&&n.__N_SSP}),this.components[\\"/_app\\"]={Component:o,styleSheets:[]},this.events=V.events,this.pageLoader=a;const R=(0,_.isDynamicRoute)(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath=\\"\\",this.sub=c,this.clc=null,this._wrapApp=i,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.isExperimentalCompile||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||!R&&!self.location.search),this.state={route:b,pathname:e,query:t,asPath:R?e:r,isPreview:!!P,locale:void 0,isFallback:f},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),!r.startsWith(\\"//\\")){const n={locale:d},a=(0,h.getURL)();this._initialMatchesMiddlewarePromise=$({router:this,locale:d,asPath:a}).then(o=>(n._shouldResolveHref=r!==e,this.changeState(\\"replaceState\\",o?a:(0,y.formatWithValidation)({pathname:(0,O.addBasePath)(e),query:t}),a,n),o))}window.addEventListener(\\"popstate\\",this.onPopState)}reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(e,t,r={}){return{url:e,as:t}=k(this,e,t),this.change(\\"pushState\\",e,t,r)}replace(e,t,r={}){return{url:e,as:t}=k(this,e,t),this.change(\\"replaceState\\",e,t,r)}async _bfl(e,t,n,a){{if(!this._bfl_s&&!this._bfl_d){let t,o,{BloomFilter:i}=r(1924);try{({__routerFilterStatic:t,__routerFilterDynamic:o}=await (0,s.getClientBuildManifest)())}catch(t){if(console.error(t),a)return!0;return z({url:(0,O.addBasePath)((0,b.addLocale)(e,n||this.locale,this.defaultLocale)),router:this}),new Promise(()=>{})}t?.numHashes&&(this._bfl_s=new i(t.numItems,t.errorRate),this._bfl_s.import(t)),o?.numHashes&&(this._bfl_d=new i(o.numItems,o.errorRate),this._bfl_d.import(o))}let o=!1,i=!1;for(let{as:r,allowMatchCurrent:s}of[{as:e},{as:t}])if(r){let t=(0,u.removeTrailingSlash)(new URL(r,\\"http://n\\").pathname),l=(0,O.addBasePath)((0,b.addLocale)(t,n||this.locale));if(s||t!==(0,u.removeTrailingSlash)(new URL(this.asPath,\\"http://n\\").pathname)){for(let e of(o=o||!!this._bfl_s?.contains(t)||!!this._bfl_s?.contains(l),[t,l])){let t=e.split(\\"/\\");for(let e=0;!i&&e{})}}}}return!1}async change(e,t,r,n,a){let o,i;if(!(0,C.isLocalURL)(t))return z({url:t,router:this}),!1;let f=1===n._h;f||n.shallow||await this._bfl(r,void 0,n.locale);let d=f||n._shouldResolveHref||(0,P.parsePath)(t).pathname===(0,P.parsePath)(r).pathname,p={...this.state},T=!0!==this.isReady;this.isReady=!0;let A=this.isSsr;if(f||(this.isSsr=!1),f&&this.clc)return!1;let j=p.locale;h.ST&&performance.mark(\\"routeChange\\");let{shallow:N=!1,scroll:I=!0}=n,L={shallow:N};this._inFlightRoute&&this.clc&&(A||V.events.emit(\\"routeChangeError\\",U(),this._inFlightRoute,L),this.clc(),this.clc=null),r=(0,O.addBasePath)((0,b.addLocale)((0,S.hasBasePath)(r)?(0,v.removeBasePath)(r):r,n.locale,this.defaultLocale));let D=(0,R.removeLocale)((0,S.hasBasePath)(r)?(0,v.removeBasePath)(r):r,p.locale);this._inFlightRoute=r;let F=j!==p.locale;if(!f&&this.onlyAHashChange(D)&&!F){p.asPath=D,V.events.emit(\\"hashChangeStart\\",r,L),this.changeState(e,t,r,{...n,scroll:!1}),I&&this.scrollToHash(D);try{await this.set(p,this.components[p.route],null)}catch(e){throw(0,c.default)(e)&&e.cancelled&&V.events.emit(\\"routeChangeError\\",e,D,L),e}return V.events.emit(\\"hashChangeComplete\\",r,L),!0}let H=(0,m.parseRelativeUrl)(t),{pathname:W,query:G}=H;try{[o,{__rewrites:i}]=await Promise.all([this.pageLoader.getPageList(),(0,s.getClientBuildManifest)(),this.pageLoader.getMiddleware()])}catch(e){return z({url:r,router:this}),!1}this.urlIsNew(D)||F||(e=\\"replaceState\\");let q=r;W=W?(0,u.removeTrailingSlash)((0,v.removeBasePath)(W)):W;let Y=(0,u.removeTrailingSlash)(W),K=r.startsWith(\\"/\\")&&(0,m.parseRelativeUrl)(r).pathname;if(this.components[W]?.__appRouter)return z({url:r,router:this}),new Promise(()=>{});let Q=!!(K&&Y!==K&&(!(0,_.isDynamicRoute)(Y)||!(0,g.getRouteMatcher)((0,E.getRouteRegex)(Y))(K))),J=!n.shallow&&await $({asPath:r,locale:p.locale,router:this});if(f&&J&&(d=!1),d&&\\"/_error\\"!==W&&(n._shouldResolveHref=!0,H.pathname=B(W,o),H.pathname!==W&&(W=H.pathname,H.pathname=(0,O.addBasePath)(W),J||(t=(0,y.formatWithValidation)(H)))),!(0,C.isLocalURL)(r))return z({url:r,router:this}),!1;q=(0,R.removeLocale)((0,v.removeBasePath)(q),p.locale),Y=(0,u.removeTrailingSlash)(W);let Z=!1;if((0,_.isDynamicRoute)(Y)){let e=(0,m.parseRelativeUrl)(q),n=e.pathname,a=(0,E.getRouteRegex)(Y);Z=(0,g.getRouteMatcher)(a)(n);let o=Y===n,i=o?(0,M.interpolateAs)(Y,n,G):{};if(Z&&(!o||i.result))o?r=(0,y.formatWithValidation)(Object.assign({},e,{pathname:i.result,query:(0,x.omit)(G,i.params)})):Object.assign(G,Z);else{let e=Object.keys(a.groups).filter(e=>!G[e]&&!a.groups[e].optional);if(e.length>0&&!J)throw Object.defineProperty(Error((o?`The provided \\\\`href\\\\` (${t}) value is missing query values (${e.join(\\", \\")}) to be interpolated properly. `:`The provided \\\\`as\\\\` value (${n}) is incompatible with the \\\\`href\\\\` value (${Y}). `)+`Read more: https://nextjs.org/docs/messages/${o?\\"href-interpolation-failed\\":\\"incompatible-href-as\\"}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E344\\",enumerable:!1,configurable:!0})}}f||V.events.emit(\\"routeChangeStart\\",r,L);let ee=\\"/404\\"===this.pathname||\\"/_error\\"===this.pathname;try{let i=await this.getRouteInfo({route:Y,pathname:W,query:G,as:r,resolvedAs:q,routeProps:L,locale:p.locale,isPreview:p.isPreview,hasMiddleware:J,unstable_skipClientCache:n.unstable_skipClientCache,isQueryUpdating:f&&!this.isFallback,isMiddlewareRewrite:Q});if(f||n.shallow||await this._bfl(r,\\"resolvedAs\\"in i?i.resolvedAs:void 0,p.locale),\\"route\\"in i&&J){Y=W=i.route||Y,L.shallow||(G=Object.assign({},i.query||{},G));let e=(0,S.hasBasePath)(H.pathname)?(0,v.removeBasePath)(H.pathname):H.pathname;if(Z&&W!==e&&Object.keys(Z).forEach(e=>{Z&&G[e]===Z[e]&&delete G[e]}),(0,_.isDynamicRoute)(W)){let e=!L.shallow&&i.resolvedAs?i.resolvedAs:(0,O.addBasePath)((0,b.addLocale)(new URL(r,location.href).pathname,p.locale),!0);(0,S.hasBasePath)(e)&&(e=(0,v.removeBasePath)(e));let t=(0,E.getRouteRegex)(W),n=(0,g.getRouteMatcher)(t)(new URL(e,location.href).pathname);n&&Object.assign(G,n)}}if(\\"type\\"in i)if(\\"redirect-internal\\"===i.type)return this.change(e,i.newUrl,i.newAs,n);else return z({url:i.destination,router:this}),new Promise(()=>{});let u=i.Component;if(u&&u.unstable_scriptLoader&&[].concat(u.unstable_scriptLoader()).forEach(e=>{(0,l.handleClientScriptLoad)(e.props)}),(i.__N_SSG||i.__N_SSP)&&i.props){if(i.props.pageProps&&i.props.pageProps.__N_REDIRECT){n.locale=!1;let t=i.props.pageProps.__N_REDIRECT;if(t.startsWith(\\"/\\")&&!1!==i.props.pageProps.__N_REDIRECT_BASE_PATH){let r=(0,m.parseRelativeUrl)(t);r.pathname=B(r.pathname,o);let{url:a,as:i}=k(this,t,t);return this.change(e,a,i,n)}return z({url:t,router:this}),new Promise(()=>{})}if(p.isPreview=!!i.props.__N_PREVIEW,i.props.notFound===X){let e;try{await this.fetchComponent(\\"/404\\"),e=\\"/404\\"}catch(t){e=\\"/_error\\"}if(i=await this.getRouteInfo({route:e,pathname:e,query:G,as:r,resolvedAs:q,routeProps:{shallow:!1},locale:p.locale,isPreview:p.isPreview,isNotFound:!0}),\\"type\\"in i)throw Object.defineProperty(Error(\\"Unexpected middleware effect on /404\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E158\\",enumerable:!1,configurable:!0})}}f&&\\"/_error\\"===this.pathname&&self.__NEXT_DATA__.props?.pageProps?.statusCode===500&&i.props?.pageProps&&(i.props.pageProps.statusCode=500);let s=n.shallow&&p.route===(i.route??Y),d=n.scroll??(!f&&!s),h=a??(d?{x:0,y:0}:null),y={...p,route:Y,pathname:W,query:G,asPath:D,isFallback:!1};if(f&&ee){if(i=await this.getRouteInfo({route:this.pathname,pathname:this.pathname,query:G,as:r,resolvedAs:q,routeProps:{shallow:!1},locale:p.locale,isPreview:p.isPreview,isQueryUpdating:f&&!this.isFallback}),\\"type\\"in i)throw Object.defineProperty(Error(`Unexpected middleware effect on ${this.pathname}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E225\\",enumerable:!1,configurable:!0});\\"/_error\\"===this.pathname&&self.__NEXT_DATA__.props?.pageProps?.statusCode===500&&i.props?.pageProps&&(i.props.pageProps.statusCode=500);try{await this.set(y,i,h)}catch(e){throw(0,c.default)(e)&&e.cancelled&&V.events.emit(\\"routeChangeError\\",e,D,L),e}return!0}if(V.events.emit(\\"beforeHistoryChange\\",r,L),this.changeState(e,t,r,n),!(f&&!h&&!T&&!F&&(0,w.compareRouterStates)(y,this.state))){try{await this.set(y,i,h)}catch(e){if(e.cancelled)i.error=i.error||e;else throw e}if(i.error)throw f||V.events.emit(\\"routeChangeError\\",i.error,D,L),i.error;f||V.events.emit(\\"routeChangeComplete\\",r,L),d&&/#.+$/.test(r)&&this.scrollToHash(r)}return!0}catch(e){if((0,c.default)(e)&&e.cancelled)return!1;throw e}}changeState(e,t,r,n={}){(\\"pushState\\"!==e||(0,h.getURL)()!==r)&&(this._shallow=n.shallow,window.history[e]({url:t,as:r,options:n,__N:!0,key:this._key=\\"pushState\\"!==e?this._key:q()},\\"\\",r))}async handleRouteInfoError(e,t,r,n,a,o){if(e.cancelled)throw e;if((0,s.isAssetError)(e)||o)throw V.events.emit(\\"routeChangeError\\",e,n,a),z({url:n,router:this}),U();console.error(e);try{let n,{page:a,styleSheets:o}=await this.fetchComponent(\\"/_error\\"),i={props:n,Component:a,styleSheets:o,err:e,error:e};if(!i.props)try{i.props=await this.getInitialProps(a,{err:e,pathname:t,query:r})}catch(e){console.error(\\"Error in error page `getInitialProps`: \\",e),i.props={}}return i}catch(e){return this.handleRouteInfoError((0,c.default)(e)?e:Object.defineProperty(Error(e+\\"\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E394\\",enumerable:!1,configurable:!0}),t,r,n,a,!0)}}async getRouteInfo({route:e,pathname:t,query:r,as:n,resolvedAs:a,routeProps:o,locale:i,hasMiddleware:s,isPreview:l,unstable_skipClientCache:f,isQueryUpdating:p,isMiddlewareRewrite:h,isNotFound:_}){let m=e;try{let e=this.components[m];if(o.shallow&&e&&this.route===m)return e;let c=Y({route:m,router:this});s&&(e=void 0);let g=!e||\\"initial\\"in e?void 0:e,E={dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:t,query:r}),skipInterpolation:!0,asPath:_?\\"/404\\":a,locale:i}),hasMiddleware:!0,isServerRender:this.isSsr,parseJSON:!0,inflightCache:p?this.sbc:this.sdc,persistCache:!l,isPrefetch:!1,unstable_skipClientCache:f,isBackground:p},P=p&&!h?null:await H({fetchData:()=>G(E),asPath:_?\\"/404\\":a,locale:i,router:this}).catch(e=>{if(p)return null;throw e});if(P&&(\\"/_error\\"===t||\\"/404\\"===t)&&(P.effect=void 0),p&&(P?P.json=self.__NEXT_DATA__.props:P={json:self.__NEXT_DATA__.props}),c(),P?.effect?.type===\\"redirect-internal\\"||P?.effect?.type===\\"redirect-external\\")return P.effect;if(P?.effect?.type===\\"rewrite\\"){let n=(0,u.removeTrailingSlash)(P.effect.resolvedHref),i=await this.pageLoader.getPageList();if((!p||i.includes(n))&&(m=n,t=P.effect.resolvedHref,r={...r,...P.effect.parsedAs.query},a=(0,v.removeBasePath)((0,d.normalizeLocalePath)(P.effect.parsedAs.pathname,this.locales).pathname),e=this.components[m],o.shallow&&e&&this.route===m&&!s))return{...e,route:m}}if((0,A.isAPIRoute)(m))return z({url:n,router:this}),new Promise(()=>{});let b=g||await this.fetchComponent(m).then(e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP})),R=P?.response?.headers.get(\\"x-middleware-skip\\"),O=b.__N_SSG||b.__N_SSP;R&&P?.dataHref&&delete this.sdc[P.dataHref];let{props:S,cacheKey:T}=await this._getData(async()=>{if(O){if(P?.json&&!R)return{cacheKey:P.cacheKey,props:P.json};let e=P?.dataHref?P.dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:t,query:r}),asPath:a,locale:i}),n=await G({dataHref:e,isServerRender:this.isSsr,parseJSON:!0,inflightCache:R?{}:this.sdc,persistCache:!l,isPrefetch:!1,unstable_skipClientCache:f});return{cacheKey:n.cacheKey,props:n.json||{}}}return{headers:{},props:await this.getInitialProps(b.Component,{pathname:t,query:r,asPath:n,locale:i,locales:this.locales,defaultLocale:this.defaultLocale})}});return b.__N_SSP&&E.dataHref&&T&&delete this.sdc[T],this.isPreview||!b.__N_SSG||p||G(Object.assign({},E,{isBackground:!0,persistCache:!1,inflightCache:this.sbc})).catch(()=>{}),S.pageProps=Object.assign({},S.pageProps),b.props=S,b.route=m,b.query=r,b.resolvedAs=a,this.components[m]=b,b}catch(e){return this.handleRouteInfoError((0,c.getProperError)(e),t,r,n,o)}}set(e,t,r){return this.state=e,this.sub(t,this.components[\\"/_app\\"].Component,r)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;let[t,r]=this.asPath.split(\\"#\\",2),[n,a]=e.split(\\"#\\",2);return!!a&&t===n&&r===a||t===n&&r!==a}scrollToHash(e){let[,t=\\"\\"]=e.split(\\"#\\",2);(0,L.disableSmoothScrollDuringRouteTransition)(()=>{if(\\"\\"===t||\\"top\\"===t)return void window.scrollTo(0,0);let e=decodeURIComponent(t),r=document.getElementById(e);if(r)return void r.scrollIntoView();let n=document.getElementsByName(e)[0];n&&n.scrollIntoView()},{onlyHashChange:this.onlyAHashChange(e)})}urlIsNew(e){return this.asPath!==e}async prefetch(e,t=e,r={}){if((0,I.isBot)(window.navigator.userAgent))return;let n=(0,m.parseRelativeUrl)(e),a=n.pathname,{pathname:o,query:i}=n,s=o,l=await this.pageLoader.getPageList(),c=t,f=void 0!==r.locale?r.locale||void 0:this.locale,d=await $({asPath:t,locale:f,router:this});n.pathname=B(n.pathname,l),(0,_.isDynamicRoute)(n.pathname)&&(o=n.pathname,n.pathname=o,Object.assign(i,(0,g.getRouteMatcher)((0,E.getRouteRegex)(n.pathname))((0,P.parsePath)(t).pathname)||{}),d||(e=(0,y.formatWithValidation)(n)));let p=await H({fetchData:()=>G({dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:s,query:i}),skipInterpolation:!0,asPath:c,locale:f}),hasMiddleware:!0,isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0}),asPath:t,locale:f,router:this});if(p?.effect.type===\\"rewrite\\"&&(n.pathname=p.effect.resolvedHref,o=p.effect.resolvedHref,i={...i,...p.effect.parsedAs.query},c=p.effect.parsedAs.pathname,e=(0,y.formatWithValidation)(n)),p?.effect.type===\\"redirect-external\\")return;let h=(0,u.removeTrailingSlash)(o);await this._bfl(t,c,r.locale,!0)&&(this.components[a]={__appRouter:!0}),await Promise.all([this.pageLoader._isSsg(h).then(t=>!!t&&G({dataHref:p?.json?p?.dataHref:this.pageLoader.getDataHref({href:e,asPath:c,locale:f}),isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0,unstable_skipClientCache:r.unstable_skipClientCache||r.priority&&!0}).then(()=>!1).catch(()=>!1)),this.pageLoader[r.priority?\\"loadPage\\":\\"prefetch\\"](h)])}async fetchComponent(e){let t=Y({route:e,router:this});try{let r=await this.pageLoader.loadPage(e);return t(),r}catch(e){throw t(),e}}_getData(e){let t=!1,r=()=>{t=!0};return this.clc=r,e().then(e=>{if(r===this.clc&&(this.clc=null),t){let e=Object.defineProperty(Error(\\"Loading initial props cancelled\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E405\\",enumerable:!1,configurable:!0});throw e.cancelled=!0,e}return e})}getInitialProps(e,t){let{Component:r}=this.components[\\"/_app\\"],n=this._wrapApp(r);return t.AppTree=n,(0,h.loadGetInitialProps)(r,{AppTree:n,Component:e,router:this,ctx:t})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}}},1714:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={default:function(){return u},isEqualNode:function(){return i}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6628);function i(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let r=t.getAttribute(\\"nonce\\");if(r&&!e.getAttribute(\\"nonce\\")){let n=t.cloneNode(!0);return n.setAttribute(\\"nonce\\",\\"\\"),n.nonce=r,r===e.nonce&&e.isEqualNode(n)}}return e.isEqualNode(t)}function u(){return{mountedInstances:new Set,updateHead:e=>{let t={};e.forEach(e=>{if(\\"link\\"===e.type&&e.props[\\"data-optimized-fonts\\"])if(document.querySelector(`style[data-href=\\"${e.props[\\"data-href\\"]}\\"]`))return;else e.props.href=e.props[\\"data-href\\"],e.props[\\"data-href\\"]=void 0;let r=t[e.type]||[];r.push(e),t[e.type]=r});let r=t.title?t.title[0]:null,n=\\"\\";if(r){let{children:e}=r.props;n=\\"string\\"==typeof e?e:Array.isArray(e)?e.join(\\"\\"):\\"\\"}n!==document.title&&(document.title=n),[\\"meta\\",\\"base\\",\\"link\\",\\"style\\",\\"script\\"].forEach(e=>{!function(e,t){let r=document.querySelector(\\"head\\");if(!r)return;let n=new Set(r.querySelectorAll(`${e}[data-next-head]`));if(\\"meta\\"===e){let e=r.querySelector(\\"meta[charset]\\");null!==e&&n.add(e)}let a=[];for(let e=0;e{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return i}});let n=r(4252)._(r(9046));class a{constructor(e,t,r){this.name=e,this.attributes=t.attributes??{},this.startTime=t.startTime??Date.now(),this.onSpanEnd=r,this.state={state:\\"inprogress\\"}}end(e){if(\\"ended\\"===this.state.state)throw Object.defineProperty(Error(\\"Span has already ended\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E17\\",enumerable:!1,configurable:!0});this.state={state:\\"ended\\",endTime:e??Date.now()},this.onSpanEnd(this)}}class o{startSpan(e,t){return new a(e,t,this.handleSpanEnd)}onSpanEnd(e){return this._emitter.on(\\"spanend\\",e),()=>{this._emitter.off(\\"spanend\\",e)}}constructor(){this._emitter=(0,n.default)(),this.handleSpanEnd=e=>{this._emitter.emit(\\"spanend\\",e)}}}let i=new o;(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1924:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"BloomFilter\\",{enumerable:!0,get:function(){return r}});class r{constructor(e,t=1e-4){this.numItems=e,this.errorRate=t,this.numBits=Math.ceil(-(e*Math.log(t))/(Math.log(2)*Math.log(2))),this.numHashes=Math.ceil(this.numBits/e*Math.log(2)),this.bitArray=Array(this.numBits).fill(0)}static from(e,t=1e-4){let n=new r(e.length,t);for(let t of e)n.add(t);return n}export(){return{numItems:this.numItems,errorRate:this.errorRate,numBits:this.numBits,numHashes:this.numHashes,bitArray:this.bitArray}}import(e){this.numItems=e.numItems,this.errorRate=e.errorRate,this.numBits=e.numBits,this.numHashes=e.numHashes,this.bitArray=e.bitArray}add(e){this.getHashValues(e).forEach(e=>{this.bitArray[e]=1})}contains(e){return this.getHashValues(e).every(e=>this.bitArray[e])}getHashValues(e){let t=[];for(let r=1;r<=this.numHashes;r++){let n=function(e){let t=0;for(let r=0;r>>13,t=Math.imul(t,0x5bd1e995);return t>>>0}(`${e}${r}`)%this.numBits;t.push(n)}return t}}},1965:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={AppRouterContext:function(){return i},GlobalLayoutRouterContext:function(){return s},LayoutRouterContext:function(){return u},MissingSlotContext:function(){return c},TemplateContext:function(){return l}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4252)._(r(4232)),i=o.default.createContext(null),u=o.default.createContext(null),s=o.default.createContext(null),l=o.default.createContext(null),c=o.default.createContext(new Set)},2117:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),r(8757),self.__next_set_public_path__=e=>{r.p=e},(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2234:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={PathnameContextProviderAdapter:function(){return _},adaptForAppRouterInstance:function(){return d},adaptForPathParams:function(){return h},adaptForSearchParams:function(){return p}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(8365),i=r(7876),u=o._(r(4232)),s=r(760),l=r(6928),c=r(970),f=r(1591);function d(e){return{back(){e.back()},forward(){e.forward()},refresh(){e.reload()},hmrRefresh(){},push(t,{scroll:r}={}){e.push(t,void 0,{scroll:r})},replace(t,{scroll:r}={}){e.replace(t,void 0,{scroll:r})},prefetch(t){e.prefetch(t)}}}function p(e){return e.isReady&&e.query?(0,c.asPathToSearchParams)(e.asPath):new URLSearchParams}function h(e){if(!e.isReady||!e.query)return null;let t={};for(let r of Object.keys((0,f.getRouteRegex)(e.pathname).groups))t[r]=e.query[r];return t}function _({children:e,router:t,...r}){let n=(0,u.useRef)(r.isAutoExport),a=(0,u.useMemo)(()=>{let e,r=n.current;if(r&&(n.current=!1),(0,l.isDynamicRoute)(t.pathname)&&(t.isFallback||r&&!t.isReady))return null;try{e=new URL(t.asPath,\\"http://f\\")}catch(e){return\\"/\\"}return e.pathname},[t.asPath,t.isFallback,t.isReady,t.pathname]);return(0,i.jsx)(s.PathnameContext.Provider,{value:a,children:e})}},2326:(e,t)=>{\\"use strict\\";function r(e){return\\"/api\\"===e||!!(null==e?void 0:e.startsWith(\\"/api/\\"))}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"isAPIRoute\\",{enumerable:!0,get:function(){return r}})},2404:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={isRecoverableError:function(){return c},onRecoverableError:function(){return f}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4252),i=r(4808),u=o._(r(6240)),s=r(7508),l=new WeakSet;function c(e){return l.has(e)}let f=e=>{let t=(0,u.default)(e)&&\\"cause\\"in e?e.cause:e;(0,i.isBailoutToCSRError)(t)||(0,s.reportGlobalError)(t)};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2454:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"isLocalURL\\",{enumerable:!0,get:function(){return o}});let n=r(9313),a=r(9348);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},2640:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={cancelIdleCallback:function(){return o},requestIdleCallback:function(){return a}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=\\"undefined\\"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},o=\\"undefined\\"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3209:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={default:function(){return y},handleClientScriptLoad:function(){return m},initScriptLoader:function(){return g}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4252),i=r(8365),u=r(7876),s=o._(r(8477)),l=i._(r(4232)),c=r(6972),f=r(6628),d=r(2640),p=new Map,h=new Set,_=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:a=null,dangerouslySetInnerHTML:o,children:i=\\"\\",strategy:u=\\"afterInteractive\\",onError:l,stylesheets:c}=e,d=r||t;if(d&&h.has(d))return;if(p.has(t)){h.add(d),p.get(t).then(n,l);return}let _=()=>{a&&a(),h.add(d)},m=document.createElement(\\"script\\"),g=new Promise((e,t)=>{m.addEventListener(\\"load\\",function(t){e(),n&&n.call(this,t),_()}),m.addEventListener(\\"error\\",function(e){t(e)})}).catch(function(e){l&&l(e)});o?(m.innerHTML=o.__html||\\"\\",_()):i?(m.textContent=\\"string\\"==typeof i?i:Array.isArray(i)?i.join(\\"\\"):\\"\\",_()):t&&(m.src=t,p.set(t,g)),(0,f.setAttributesFromProps)(m,e),\\"worker\\"===u&&m.setAttribute(\\"type\\",\\"text/partytown\\"),m.setAttribute(\\"data-nscript\\",u),c&&(e=>{if(s.default.preinit)return e.forEach(e=>{s.default.preinit(e,{as:\\"style\\"})});{let t=document.head;e.forEach(e=>{let r=document.createElement(\\"link\\");r.type=\\"text/css\\",r.rel=\\"stylesheet\\",r.href=e,t.appendChild(r)})}})(c),document.body.appendChild(m)};function m(e){let{strategy:t=\\"afterInteractive\\"}=e;\\"lazyOnload\\"===t?window.addEventListener(\\"load\\",()=>{(0,d.requestIdleCallback)(()=>_(e))}):_(e)}function g(e){e.forEach(m),[...document.querySelectorAll(\'[data-nscript=\\"beforeInteractive\\"]\'),...document.querySelectorAll(\'[data-nscript=\\"beforePageRender\\"]\')].forEach(e=>{let t=e.id||e.getAttribute(\\"src\\");h.add(t)})}function E(e){let{id:t,src:r=\\"\\",onLoad:n=()=>{},onReady:a=null,strategy:o=\\"afterInteractive\\",onError:i,stylesheets:f,...p}=e,{updateScripts:m,scripts:g,getIsSsr:E,appDir:y,nonce:P}=(0,l.useContext)(c.HeadManagerContext);P=p.nonce||P;let b=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let e=t||r;b.current||(a&&e&&h.has(e)&&a(),b.current=!0)},[a,t,r]);let R=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!R.current){if(\\"afterInteractive\\"===o)_(e);else\\"lazyOnload\\"===o&&(\\"complete\\"===document.readyState?(0,d.requestIdleCallback)(()=>_(e)):window.addEventListener(\\"load\\",()=>{(0,d.requestIdleCallback)(()=>_(e))}));R.current=!0}},[e,o]),(\\"beforeInteractive\\"===o||\\"worker\\"===o)&&(m?(g[o]=(g[o]||[]).concat([{id:t,src:r,onLoad:n,onReady:a,onError:i,...p,nonce:P}]),m(g)):E&&E()?h.add(t||r):E&&!E()&&_({...e,nonce:P})),y){if(f&&f.forEach(e=>{s.default.preinit(e,{as:\\"style\\"})}),\\"beforeInteractive\\"===o)if(!r)return p.dangerouslySetInnerHTML&&(p.children=p.dangerouslySetInnerHTML.__html,delete p.dangerouslySetInnerHTML),(0,u.jsx)(\\"script\\",{nonce:P,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...p,id:t}])})`}});else return s.default.preload(r,p.integrity?{as:\\"script\\",integrity:p.integrity,nonce:P,crossOrigin:p.crossOrigin}:{as:\\"script\\",nonce:P,crossOrigin:p.crossOrigin}),(0,u.jsx)(\\"script\\",{nonce:P,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([r,{...p,id:t}])})`}});\\"afterInteractive\\"===o&&r&&s.default.preload(r,p.integrity?{as:\\"script\\",integrity:p.integrity,nonce:P,crossOrigin:p.crossOrigin}:{as:\\"script\\",nonce:P,crossOrigin:p.crossOrigin})}return null}Object.defineProperty(E,\\"__nextScript\\",{value:!0});let y=E;(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3227:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={getObjectClassLabel:function(){return a},isPlainObject:function(){return o}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});function a(e){return Object.prototype.toString.call(e)}function o(e){if(\\"[object Object]\\"!==a(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty(\\"isPrototypeOf\\")}},3438:(e,t)=>{\\"use strict\\";function r(e){return e.replace(/\\\\\\\\/g,\\"/\\")}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"normalizePathSep\\",{enumerable:!0,get:function(){return r}})},3467:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"addBasePath\\",{enumerable:!0,get:function(){return o}});let n=r(5760),a=r(6720);function o(e,t){return(0,a.normalizePathTrailingSlash)((0,n.addPathPrefix)(e,\\"\\"))}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3673:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"addPathSuffix\\",{enumerable:!0,get:function(){return a}});let n=r(4625);function a(e,t){if(!e.startsWith(\\"/\\")||!t)return e;let{pathname:r,query:a,hash:o}=(0,n.parsePath)(e);return`${r}${t}${a}${o}`}},3773:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"detectDomainLocale\\",{enumerable:!0,get:function(){return r}});let r=(...e)=>{};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3775:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"normalizeLocalePath\\",{enumerable:!0,get:function(){return n}});let r=new WeakMap;function n(e,t){let n;if(!t)return{pathname:e};let a=r.get(t);a||(a=t.map(e=>e.toLowerCase()),r.set(t,a));let o=e.split(\\"/\\",2);if(!o[1])return{pathname:e};let i=o[1].toLowerCase(),u=a.indexOf(i);return u<0?{pathname:e}:(n=t[u],{pathname:e=e.slice(n.length+1)||\\"/\\",detectedLocale:n})}},4101:(e,t,r)=>{\\"use strict\\";var n,a=r(5364);Object.defineProperty(t,\\"__esModule\\",{value:!0});var o={APP_CLIENT_INTERNALS:function(){return et},APP_PATHS_MANIFEST:function(){return P},APP_PATH_ROUTES_MANIFEST:function(){return b},AdapterOutputType:function(){return f},BARREL_OPTIMIZATION_PREFIX:function(){return q},BLOCKED_PAGES:function(){return B},BUILD_ID_FILE:function(){return k},BUILD_MANIFEST:function(){return R},CLIENT_PUBLIC_FILES_PATH:function(){return H},CLIENT_REFERENCE_MANIFEST:function(){return z},CLIENT_STATIC_FILES_PATH:function(){return X},CLIENT_STATIC_FILES_RUNTIME_MAIN:function(){return Z},CLIENT_STATIC_FILES_RUNTIME_MAIN_APP:function(){return ee},CLIENT_STATIC_FILES_RUNTIME_POLYFILLS:function(){return ea},CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL:function(){return eo},CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH:function(){return er},CLIENT_STATIC_FILES_RUNTIME_WEBPACK:function(){return en},COMPILER_INDEXES:function(){return c},COMPILER_NAMES:function(){return l},CONFIG_FILES:function(){return F},DEFAULT_RUNTIME_WEBPACK:function(){return ei},DEFAULT_SANS_SERIF_FONT:function(){return ef},DEFAULT_SERIF_FONT:function(){return ec},DEV_CLIENT_MIDDLEWARE_MANIFEST:function(){return D},DEV_CLIENT_PAGES_MANIFEST:function(){return I},DYNAMIC_CSS_MANIFEST:function(){return J},EDGE_RUNTIME_WEBPACK:function(){return eu},EDGE_UNSUPPORTED_NODE_APIS:function(){return em},EXPORT_DETAIL:function(){return A},EXPORT_MARKER:function(){return T},FUNCTIONS_CONFIG_MANIFEST:function(){return v},IMAGES_MANIFEST:function(){return w},INTERCEPTION_ROUTE_REWRITE_MANIFEST:function(){return Q},MIDDLEWARE_BUILD_MANIFEST:function(){return V},MIDDLEWARE_MANIFEST:function(){return x},MIDDLEWARE_REACT_LOADABLE_MANIFEST:function(){return K},MODERN_BROWSERSLIST_TARGET:function(){return u.default},NEXT_BUILTIN_DOCUMENT:function(){return G},NEXT_FONT_MANIFEST:function(){return S},PAGES_MANIFEST:function(){return E},PHASE_DEVELOPMENT_SERVER:function(){return _},PHASE_EXPORT:function(){return d},PHASE_INFO:function(){return g},PHASE_PRODUCTION_BUILD:function(){return p},PHASE_PRODUCTION_SERVER:function(){return h},PHASE_TEST:function(){return m},PRERENDER_MANIFEST:function(){return j},REACT_LOADABLE_MANIFEST:function(){return U},ROUTES_MANIFEST:function(){return N},RSC_MODULE_TYPES:function(){return e_},SERVER_DIRECTORY:function(){return $},SERVER_FILES_MANIFEST:function(){return C},SERVER_PROPS_ID:function(){return el},SERVER_REFERENCE_MANIFEST:function(){return Y},STATIC_PROPS_ID:function(){return es},STATIC_STATUS_PAGES:function(){return ed},STRING_LITERAL_DROP_BUNDLE:function(){return W},SUBRESOURCE_INTEGRITY_MANIFEST:function(){return O},SYSTEM_ENTRYPOINTS:function(){return eg},TRACE_OUTPUT_VERSION:function(){return ep},TURBOPACK_CLIENT_BUILD_MANIFEST:function(){return L},TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST:function(){return M},TURBO_TRACE_DEFAULT_MEMORY_LIMIT:function(){return eh},UNDERSCORE_GLOBAL_ERROR_ROUTE:function(){return s.UNDERSCORE_GLOBAL_ERROR_ROUTE},UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY:function(){return s.UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY},UNDERSCORE_NOT_FOUND_ROUTE:function(){return s.UNDERSCORE_NOT_FOUND_ROUTE},UNDERSCORE_NOT_FOUND_ROUTE_ENTRY:function(){return s.UNDERSCORE_NOT_FOUND_ROUTE_ENTRY},WEBPACK_STATS:function(){return y}};for(var i in o)Object.defineProperty(t,i,{enumerable:!0,get:o[i]});let u=r(4252)._(r(1579)),s=r(5156),l={client:\\"client\\",server:\\"server\\",edgeServer:\\"edge-server\\"},c={[l.client]:0,[l.server]:1,[l.edgeServer]:2};var f=((n={}).PAGES=\\"PAGES\\",n.PAGES_API=\\"PAGES_API\\",n.APP_PAGE=\\"APP_PAGE\\",n.APP_ROUTE=\\"APP_ROUTE\\",n.PRERENDER=\\"PRERENDER\\",n.STATIC_FILE=\\"STATIC_FILE\\",n.MIDDLEWARE=\\"MIDDLEWARE\\",n);let d=\\"phase-export\\",p=\\"phase-production-build\\",h=\\"phase-production-server\\",_=\\"phase-development-server\\",m=\\"phase-test\\",g=\\"phase-info\\",E=\\"pages-manifest.json\\",y=\\"webpack-stats.json\\",P=\\"app-paths-manifest.json\\",b=\\"app-path-routes-manifest.json\\",R=\\"build-manifest.json\\",v=\\"functions-config-manifest.json\\",O=\\"subresource-integrity-manifest\\",S=\\"next-font-manifest\\",T=\\"export-marker.json\\",A=\\"export-detail.json\\",j=\\"prerender-manifest.json\\",N=\\"routes-manifest.json\\",w=\\"images-manifest.json\\",C=\\"required-server-files.json\\",I=\\"_devPagesManifest.json\\",x=\\"middleware-manifest.json\\",M=\\"_clientMiddlewareManifest.json\\",L=\\"client-build-manifest.json\\",D=\\"_devMiddlewareManifest.json\\",U=\\"react-loadable-manifest.json\\",$=\\"server\\",F=[\\"next.config.js\\",\\"next.config.mjs\\",\\"next.config.ts\\",...a?.features?.typescript?[\\"next.config.mts\\"]:[]],k=\\"BUILD_ID\\",B=[\\"/_document\\",\\"/_app\\",\\"/_error\\"],H=\\"public\\",X=\\"static\\",W=\\"__NEXT_DROP_CLIENT_FILE__\\",G=\\"__NEXT_BUILTIN_DOCUMENT__\\",q=\\"__barrel_optimize__\\",z=\\"client-reference-manifest\\",Y=\\"server-reference-manifest\\",V=\\"middleware-build-manifest\\",K=\\"middleware-react-loadable-manifest\\",Q=\\"interception-route-rewrite-manifest\\",J=\\"dynamic-css-manifest\\",Z=\\"main\\",ee=`${Z}-app`,et=\\"app-pages-internals\\",er=\\"react-refresh\\",en=\\"webpack\\",ea=\\"polyfills\\",eo=Symbol(ea),ei=\\"webpack-runtime\\",eu=\\"edge-runtime-webpack\\",es=\\"__N_SSG\\",el=\\"__N_SSP\\",ec={name:\\"Times New Roman\\",xAvgCharWidth:821,azAvgWidth:854.3953488372093,unitsPerEm:2048},ef={name:\\"Arial\\",xAvgCharWidth:904,azAvgWidth:934.5116279069767,unitsPerEm:2048},ed=[\\"/500\\"],ep=1,eh=6e3,e_={client:\\"client\\",server:\\"server\\"},em=[\\"clearImmediate\\",\\"setImmediate\\",\\"BroadcastChannel\\",\\"ByteLengthQueuingStrategy\\",\\"CompressionStream\\",\\"CountQueuingStrategy\\",\\"DecompressionStream\\",\\"DomException\\",\\"MessageChannel\\",\\"MessageEvent\\",\\"MessagePort\\",\\"ReadableByteStreamController\\",\\"ReadableStreamBYOBRequest\\",\\"ReadableStreamDefaultController\\",\\"TransformStreamDefaultController\\",\\"WritableStreamDefaultController\\"],eg=new Set([Z,er,ee]);(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4111:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"escapeStringRegexp\\",{enumerable:!0,get:function(){return a}});let r=/[|\\\\\\\\{}()[\\\\]^$+*?.-]/,n=/[|\\\\\\\\{}()[\\\\]^$+*?.-]/g;function a(e){return r.test(e)?e.replace(n,\\"\\\\\\\\$&\\"):e}},4252:(e,t,r)=>{\\"use strict\\";function n(e){return e&&e.__esModule?e:{default:e}}r.r(t),r.d(t,{_:()=>n})},4482:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"parseRelativeUrl\\",{enumerable:!0,get:function(){return o}});let n=r(9313),a=r(1577);function o(e,t,r=!0){let i=new URL((0,n.getLocationOrigin)()),u=t?new URL(t,i):e.startsWith(\\".\\")?new URL(window.location.href):i,{pathname:s,searchParams:l,search:c,hash:f,href:d,origin:p}=new URL(e,u);if(p!==i.origin)throw Object.defineProperty(Error(`invariant: invalid relative URL, router received ${e}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E159\\",enumerable:!1,configurable:!0});return{pathname:s,query:r?(0,a.searchParamsToUrlQuery)(l):void 0,search:c,hash:f,href:d.slice(p.length),slashes:void 0}}},4498:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={PARAM_SEPARATOR:function(){return a},hasAdjacentParameterIssues:function(){return o},normalizeAdjacentParameters:function(){return i},normalizeTokensForRegexp:function(){return u},stripNormalizedSeparators:function(){return s},stripParameterSeparators:function(){return l}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=\\"_NEXTSEP_\\";function o(e){return\\"string\\"==typeof e&&!!(/\\\\/\\\\(\\\\.{1,3}\\\\):[^/\\\\s]+/.test(e)||/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(e))}function i(e){let t=e;return(t=t.replace(/(\\\\([^)]*\\\\)):([^/\\\\s]+)/g,`$1${a}:$2`)).replace(/:([^:/\\\\s)]+)(?=:)/g,`:$1${a}`)}function u(e){return e.map(e=>\\"object\\"==typeof e&&null!==e&&\\"modifier\\"in e&&(\\"*\\"===e.modifier||\\"+\\"===e.modifier)&&\\"prefix\\"in e&&\\"suffix\\"in e&&\\"\\"===e.prefix&&\\"\\"===e.suffix?{...e,prefix:\\"/\\"}:e)}function s(e){return e.replace(RegExp(`\\\\\\\\)${a}`,\\"g\\"),\\")\\")}function l(e){let t={};for(let[r,n]of Object.entries(e))\\"string\\"==typeof n?t[r]=n.replace(RegExp(`^${a}`),\\"\\"):Array.isArray(n)?t[r]=n.map(e=>\\"string\\"==typeof e?e.replace(RegExp(`^${a}`),\\"\\"):e):t[r]=n;return t}},4504:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return o}}),r(4252);let n=r(7876);r(4232);let a=r(9603);function o(e){function t(t){return(0,n.jsx)(e,{router:(0,a.useRouter)(),...t})}return t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,t}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4625:(e,t)=>{\\"use strict\\";function r(e){let t=e.indexOf(\\"#\\"),r=e.indexOf(\\"?\\"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):\\"\\",hash:t>-1?e.slice(t):\\"\\"}:{pathname:e,query:\\"\\",hash:\\"\\"}}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"parsePath\\",{enumerable:!0,get:function(){return r}})},4808:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={BailoutToCSRError:function(){return o},isBailoutToCSRError:function(){return i}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=\\"BAILOUT_TO_CLIENT_SIDE_RENDERING\\";class o extends Error{constructor(e){super(`Bail out to client-side rendering: ${e}`),this.reason=e,this.digest=a}}function i(e){return\\"object\\"==typeof e&&null!==e&&\\"digest\\"in e&&e.digest===a}},5042:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"getRouteMatcher\\",{enumerable:!0,get:function(){return o}});let n=r(9313),a=r(7241);function o({re:e,groups:t}){return(0,a.safeRouteMatcher)(r=>{let a=e.exec(r);if(!a)return!1;let o=e=>{try{return decodeURIComponent(e)}catch{throw Object.defineProperty(new n.DecodeError(\\"failed to decode param\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E528\\",enumerable:!1,configurable:!0})}},i={};for(let[e,r]of Object.entries(t)){let t=a[r.pos];void 0!==t&&(r.repeat?i[e]=t.split(\\"/\\").map(e=>o(e)):i[e]=o(t))}return i})}},5067:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"RouterContext\\",{enumerable:!0,get:function(){return n}});let n=r(4252)._(r(4232)).default.createContext(null)},5156:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={UNDERSCORE_GLOBAL_ERROR_ROUTE:function(){return i},UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY:function(){return u},UNDERSCORE_NOT_FOUND_ROUTE:function(){return a},UNDERSCORE_NOT_FOUND_ROUTE_ENTRY:function(){return o}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=\\"/_not-found\\",o=`${a}/page`,i=\\"/_global-error\\",u=`${i}/page`},5173:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={INTERCEPTION_ROUTE_MARKERS:function(){return i},extractInterceptionRouteInformation:function(){return s},isInterceptionRouteAppPath:function(){return u}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(682),i=[\\"(..)(..)\\",\\"(.)\\",\\"(..)\\",\\"(...)\\"];function u(e){return void 0!==e.split(\\"/\\").find(e=>i.find(t=>e.startsWith(t)))}function s(e){let t,r,n;for(let a of e.split(\\"/\\"))if(r=i.find(e=>a.startsWith(e))){[t,n]=e.split(r,2);break}if(!t||!r||!n)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`),\\"__NEXT_ERROR_CODE\\",{value:\\"E269\\",enumerable:!1,configurable:!0});switch(t=(0,o.normalizeAppPath)(t),r){case\\"(.)\\":n=\\"/\\"===t?`/${n}`:t+\\"/\\"+n;break;case\\"(..)\\":if(\\"/\\"===t)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`),\\"__NEXT_ERROR_CODE\\",{value:\\"E207\\",enumerable:!1,configurable:!0});n=t.split(\\"/\\").slice(0,-1).concat(n).join(\\"/\\");break;case\\"(...)\\":n=\\"/\\"+n;break;case\\"(..)(..)\\":let a=t.split(\\"/\\");if(a.length<=2)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`),\\"__NEXT_ERROR_CODE\\",{value:\\"E486\\",enumerable:!1,configurable:!0});n=a.slice(0,-2).concat(n).join(\\"/\\");break;default:throw Object.defineProperty(Error(\\"Invariant: unexpected marker\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E112\\",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:n}}},5364:(e,t,r)=>{\\"use strict\\";var n,a;e.exports=(null==(n=r.g.process)?void 0:n.env)&&\\"object\\"==typeof(null==(a=r.g.process)?void 0:a.env)?r.g.process:r(5861)},5481:(e,t,r)=>{\\"use strict\\";function n(e,t={}){if(t.onlyHashChange)return void e();let r=document.documentElement;if(\\"smooth\\"!==r.dataset.scrollBehavior)return void e();let a=r.style.scrollBehavior;r.style.scrollBehavior=\\"auto\\",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=a}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"disableSmoothScrollDuringRouteTransition\\",{enumerable:!0,get:function(){return n}}),r(8912)},5526:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"ImageConfigContext\\",{enumerable:!0,get:function(){return o}});let n=r(4252)._(r(4232)),a=r(946),o=n.default.createContext(a.imageConfigDefault)},5692:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={getParamProperties:function(){return s},getSegmentParam:function(){return i},isCatchAll:function(){return u}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(5173);function i(e){let t=o.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith(\\"[[...\\")&&e.endsWith(\\"]]\\"))?{type:\\"optional-catchall\\",param:e.slice(5,-2)}:e.startsWith(\\"[...\\")&&e.endsWith(\\"]\\")?{type:t?`catchall-intercepted-${t}`:\\"catchall\\",param:e.slice(4,-1)}:e.startsWith(\\"[\\")&&e.endsWith(\\"]\\")?{type:t?`dynamic-intercepted-${t}`:\\"dynamic\\",param:e.slice(1,-1)}:null}function u(e){return\\"catchall\\"===e||\\"catchall-intercepted-(..)(..)\\"===e||\\"catchall-intercepted-(.)\\"===e||\\"catchall-intercepted-(..)\\"===e||\\"catchall-intercepted-(...)\\"===e||\\"optional-catchall\\"===e}function s(e){let t=!1,r=!1;switch(e){case\\"catchall\\":case\\"catchall-intercepted-(..)(..)\\":case\\"catchall-intercepted-(.)\\":case\\"catchall-intercepted-(..)\\":case\\"catchall-intercepted-(...)\\":t=!0;break;case\\"optional-catchall\\":t=!0,r=!0}return{repeat:t,optional:r}}},5737:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={RouteAnnouncer:function(){return c},default:function(){return f}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4252),i=r(7876),u=o._(r(4232)),s=r(9603),l={border:0,clip:\\"rect(0 0 0 0)\\",height:\\"1px\\",margin:\\"-1px\\",overflow:\\"hidden\\",padding:0,position:\\"absolute\\",top:0,width:\\"1px\\",whiteSpace:\\"nowrap\\",wordWrap:\\"normal\\"},c=()=>{let{asPath:e}=(0,s.useRouter)(),[t,r]=u.default.useState(\\"\\"),n=u.default.useRef(e);return u.default.useEffect(()=>{if(n.current!==e)if(n.current=e,document.title)r(document.title);else{let t=document.querySelector(\\"h1\\");r((t?.innerText??t?.textContent)||e)}},[e]),(0,i.jsx)(\\"p\\",{\\"aria-live\\":\\"assertive\\",id:\\"__next-route-announcer__\\",role:\\"alert\\",style:l,children:t})},f=c;(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5760:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"addPathPrefix\\",{enumerable:!0,get:function(){return a}});let n=r(4625);function a(e,t){if(!e.startsWith(\\"/\\")||!t)return e;let{pathname:r,query:a,hash:o}=(0,n.parsePath)(e);return`${t}${r}${a}${o}`}},5861:e=>{var t={229:function(e){var t,r,n,a=e.exports={};function o(){throw Error(\\"setTimeout has not been defined\\")}function i(){throw Error(\\"clearTimeout has not been defined\\")}try{t=\\"function\\"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r=\\"function\\"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}function u(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var s=[],l=!1,c=-1;function f(){l&&n&&(l=!1,n.length?s=n.concat(s):c=-1,s.length&&d())}function d(){if(!l){var e=u(f);l=!0;for(var t=s.length;t;){for(n=s,s=[];++c1)for(var r=1;r{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"resolveHref\\",{enumerable:!0,get:function(){return p}});let n=r(1577),a=r(7855),o=r(53),i=r(9313),u=r(6720),s=r(2454),l=r(6928),c=r(8918),f=r(1591),d=r(5042);function p(e,t,r){let p,h=\\"string\\"==typeof t?t:(0,a.formatWithValidation)(t),_=h.match(/^[a-z][a-z0-9+.-]*:\\\\/\\\\//i),m=_?h.slice(_[0].length):h;if((m.split(\\"?\\",1)[0]||\\"\\").match(/(\\\\/\\\\/|\\\\\\\\)/)){console.error(`Invalid href \'${h}\' passed to next/router in page: \'${e.pathname}\'. Repeated forward-slashes (//) or backslashes \\\\\\\\ are not valid in the href.`);let t=(0,i.normalizeRepeatedSlashes)(m);h=(_?_[0]:\\"\\")+t}if(!(0,s.isLocalURL)(h))return r?[h]:h;try{let t=h.startsWith(\\"#\\")?e.asPath:e.pathname;if(h.startsWith(\\"?\\")&&(t=e.asPath,(0,l.isDynamicRoute)(e.pathname))){t=e.pathname;let r=(0,f.getRouteRegex)(e.pathname);(0,d.getRouteMatcher)(r)(e.asPath)||(t=e.asPath)}p=new URL(t,\\"http://n\\")}catch(e){p=new URL(\\"/\\",\\"http://n\\")}try{let e=new URL(h,p);e.pathname=(0,u.normalizePathTrailingSlash)(e.pathname);let t=\\"\\";if((0,l.isDynamicRoute)(e.pathname)&&e.searchParams&&r){let r=(0,n.searchParamsToUrlQuery)(e.searchParams),{result:i,params:u}=(0,c.interpolateAs)(e.pathname,e.pathname,r);i&&(t=(0,a.formatWithValidation)({pathname:i,hash:e.hash,query:(0,o.omit)(r,u)}))}let i=e.origin===p.origin?e.href.slice(e.origin.length):e.href;return r?[i,t||i]:i}catch(e){return r?[h]:h}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6150:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"HTML_LIMITED_BOT_UA_RE\\",{enumerable:!0,get:function(){return r}});let r=/[\\\\w-]+-Google|Google-[\\\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight/i},6231:(e,t)=>{\\"use strict\\";function r(e){return e.startsWith(\\"/\\")?e:`/${e}`}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"ensureLeadingSlash\\",{enumerable:!0,get:function(){return r}})},6240:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={default:function(){return i},getProperError:function(){return u}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(3227);function i(e){return\\"object\\"==typeof e&&null!==e&&\\"name\\"in e&&\\"message\\"in e}function u(e){let t;return i(e)?e:Object.defineProperty(Error((0,o.isPlainObject)(e)?(t=new WeakSet,JSON.stringify(e,(e,r)=>{if(\\"object\\"==typeof r&&null!==r){if(t.has(r))return\\"[Circular]\\";t.add(r)}return r})):e+\\"\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E394\\",enumerable:!1,configurable:!0})}},6628:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"setAttributesFromProps\\",{enumerable:!0,get:function(){return o}});let r={acceptCharset:\\"accept-charset\\",className:\\"class\\",htmlFor:\\"for\\",httpEquiv:\\"http-equiv\\",noModule:\\"noModule\\"},n=[\\"onLoad\\",\\"onReady\\",\\"dangerouslySetInnerHTML\\",\\"children\\",\\"onError\\",\\"strategy\\",\\"stylesheets\\"];function a(e){return[\\"async\\",\\"defer\\",\\"noModule\\"].includes(e)}function o(e,t){for(let[o,i]of Object.entries(t)){if(!t.hasOwnProperty(o)||n.includes(o)||void 0===i)continue;let u=r[o]||o.toLowerCase();\\"SCRIPT\\"===e.tagName&&a(u)?e[u]=!!i:e.setAttribute(u,String(i)),(!1===i||\\"SCRIPT\\"===e.tagName&&a(u)&&(!i||\\"false\\"===i))&&(e.setAttribute(u,\\"\\"),e.removeAttribute(u))}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6720:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"normalizePathTrailingSlash\\",{enumerable:!0,get:function(){return o}});let n=r(495),a=r(4625),o=e=>{if(!e.startsWith(\\"/\\"))return e;let{pathname:t,query:r,hash:o}=(0,a.parsePath)(e);return`${(0,n.removeTrailingSlash)(t)}${r}${o}`};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6780:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={HTTPAccessErrorStatus:function(){return a},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return i},getAccessFallbackErrorTypeByStatus:function(){return l},getAccessFallbackHTTPStatus:function(){return s},isHTTPAccessFallbackError:function(){return u}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},o=new Set(Object.values(a)),i=\\"NEXT_HTTP_ERROR_FALLBACK\\";function u(e){if(\\"object\\"!=typeof e||null===e||!(\\"digest\\"in e)||\\"string\\"!=typeof e.digest)return!1;let[t,r]=e.digest.split(\\";\\");return t===i&&o.has(Number(r))}function s(e){return Number(e.digest.split(\\";\\")[1])}function l(e){switch(e){case 401:return\\"unauthorized\\";case 403:return\\"forbidden\\";case 404:return\\"not-found\\";default:return}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6851:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"removePathPrefix\\",{enumerable:!0,get:function(){return a}});let n=r(921);function a(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith(\\"/\\")?r:`/${r}`}},6873:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"formatNextPathnameInfo\\",{enumerable:!0,get:function(){return u}});let n=r(495),a=r(5760),o=r(3673),i=r(6904);function u(e){let t=(0,i.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,o.addPathSuffix)((0,a.addPathPrefix)(t,`/_next/data/${e.buildId}`),\\"/\\"===e.pathname?\\"index.json\\":\\".json\\")),t=(0,a.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith(\\"/\\")?t:(0,o.addPathSuffix)(t,\\"/\\"):(0,n.removeTrailingSlash)(t)}},6904:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"addLocale\\",{enumerable:!0,get:function(){return o}});let n=r(5760),a=r(921);function o(e,t,r,o){if(!t||t===r)return e;let i=e.toLowerCase();return!o&&((0,a.pathHasPrefix)(i,\\"/api\\")||(0,a.pathHasPrefix)(i,`/${t.toLowerCase()}`))?e:(0,n.addPathPrefix)(e,`/${t}`)}},6928:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={getSortedRouteObjects:function(){return o.getSortedRouteObjects},getSortedRoutes:function(){return o.getSortedRoutes},isDynamicRoute:function(){return i.isDynamicRoute}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(1450),i=r(7380)},6972:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"HeadManagerContext\\",{enumerable:!0,get:function(){return n}});let n=r(4252)._(r(4232)).default.createContext({})},7064:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"getNextPathnameInfo\\",{enumerable:!0,get:function(){return i}});let n=r(3775),a=r(6851),o=r(921);function i(e,t){let{basePath:r,i18n:i,trailingSlash:u}=t.nextConfig??{},s={pathname:e,trailingSlash:\\"/\\"!==e?e.endsWith(\\"/\\"):u};r&&(0,o.pathHasPrefix)(s.pathname,r)&&(s.pathname=(0,a.removePathPrefix)(s.pathname,r),s.basePath=r);let l=s.pathname;if(s.pathname.startsWith(\\"/_next/data/\\")&&s.pathname.endsWith(\\".json\\")){let e=s.pathname.replace(/^\\\\/_next\\\\/data\\\\//,\\"\\").replace(/\\\\.json$/,\\"\\").split(\\"/\\");s.buildId=e[0],l=\\"index\\"!==e[1]?`/${e.slice(1).join(\\"/\\")}`:\\"/\\",!0===t.parseData&&(s.pathname=l)}if(i){let e=t.i18nProvider?t.i18nProvider.analyze(s.pathname):(0,n.normalizeLocalePath)(s.pathname,i.locales);s.locale=e.detectedLocale,s.pathname=e.pathname??s.pathname,!e.detectedLocale&&s.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(l):(0,n.normalizeLocalePath)(l,i.locales)).detectedLocale&&(s.locale=e.detectedLocale)}return s}},7241:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={safeCompile:function(){return s},safePathToRegexp:function(){return u},safeRegexpToFunction:function(){return l},safeRouteMatcher:function(){return c}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(9509),i=r(4498);function u(e,t,r){if(\\"string\\"!=typeof e)return(0,o.pathToRegexp)(e,t,r);let n=(0,i.hasAdjacentParameterIssues)(e),a=n?(0,i.normalizeAdjacentParameters)(e):e;try{return(0,o.pathToRegexp)(a,t,r)}catch(a){if(!n)try{let n=(0,i.normalizeAdjacentParameters)(e);return(0,o.pathToRegexp)(n,t,r)}catch(e){}throw a}}function s(e,t){let r=(0,i.hasAdjacentParameterIssues)(e),n=r?(0,i.normalizeAdjacentParameters)(e):e;try{let e=(0,o.compile)(n,t);if(r)return t=>(0,i.stripNormalizedSeparators)(e(t));return e}catch(n){if(!r)try{let r=(0,i.normalizeAdjacentParameters)(e),n=(0,o.compile)(r,t);return e=>(0,i.stripNormalizedSeparators)(n(e))}catch(e){}throw n}}function l(e,t){let r=(0,o.regexpToFunction)(e,t||[]);return e=>{let t=r(e);return!!t&&{...t,params:(0,i.stripParameterSeparators)(t.params)}}}function c(e){return t=>{let r=e(t);return!!r&&(0,i.stripParameterSeparators)(r)}}},7258:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"RedirectStatusCode\\",{enumerable:!0,get:function(){return n}});var r,n=((r={})[r.SeeOther=303]=\\"SeeOther\\",r[r.TemporaryRedirect=307]=\\"TemporaryRedirect\\",r[r.PermanentRedirect=308]=\\"PermanentRedirect\\",r);(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7300:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={PARAMETER_PATTERN:function(){return c},getDynamicParam:function(){return l},interpolateParallelRouteParams:function(){return s},parseMatchedParameter:function(){return d},parseParameter:function(){return f}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(1407),i=r(7832),u=r(5692);function s(e,t,r,n){let a=structuredClone(t),o=[{tree:e,depth:0}],s=r.split(\\"/\\").slice(1);for(;o.length>0;){let{tree:e,depth:t}=o.pop(),{segment:r,parallelRoutes:l}=(0,i.parseLoaderTree)(e),c=(0,u.getSegmentParam)(r);if(c&&!a.hasOwnProperty(c.param)&&!n?.has(c.param))switch(c.type){case\\"catchall\\":case\\"optional-catchall\\":case\\"catchall-intercepted-(..)(..)\\":case\\"catchall-intercepted-(.)\\":case\\"catchall-intercepted-(..)\\":case\\"catchall-intercepted-(...)\\":let f=s.slice(t).flatMap(e=>{let t=(0,u.getSegmentParam)(e);return t?a[t.param]:e}).filter(e=>void 0!==e);f.length>0&&(a[c.param]=f);break;case\\"dynamic\\":case\\"dynamic-intercepted-(..)(..)\\":case\\"dynamic-intercepted-(.)\\":case\\"dynamic-intercepted-(..)\\":case\\"dynamic-intercepted-(...)\\":if(tencodeURIComponent(e)):\\"string\\"==typeof n&&(n=encodeURIComponent(n));return n}(e,t,n);if(!a||0===a.length){if(\\"oc\\"===r)return{param:t,value:null,type:r,treeSegment:[t,\\"\\",r]};throw Object.defineProperty(new o.InvariantError(`Missing value for segment key: \\"${t}\\" with dynamic param type: ${r}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E864\\",enumerable:!1,configurable:!0})}return{param:t,value:a,treeSegment:[t,Array.isArray(a)?a.join(\\"/\\"):a,r],type:r}}let c=/^([^[]*)\\\\[((?:\\\\[[^\\\\]]*\\\\])|[^\\\\]]+)\\\\](.*)$/;function f(e){let t=e.match(c);return t?d(t[2]):d(e)}function d(e){let t=e.startsWith(\\"[\\")&&e.endsWith(\\"]\\");t&&(e=e.slice(1,-1));let r=e.startsWith(\\"...\\");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}},7380:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"isDynamicRoute\\",{enumerable:!0,get:function(){return i}});let n=r(5173),a=/\\\\/[^/]*\\\\[[^/]+\\\\][^/]*(?=\\\\/|$)/,o=/\\\\/\\\\[[^/]+\\\\](?=\\\\/|$)/;function i(e,t=!0){return((0,n.isInterceptionRouteAppPath)(e)&&(e=(0,n.extractInterceptionRouteInformation)(e).interceptedRoute),t)?o.test(e):a.test(e)}},7508:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"reportGlobalError\\",{enumerable:!0,get:function(){return r}});let r=\\"function\\"==typeof reportError?reportError:e=>{globalThis.console.error(e)};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7647:(e,t,r)=>{\\"use strict\\";e.exports=r(9393)},7657:(e,t)=>{\\"use strict\\";let r;function n(e){return(void 0===r&&(r=window.trustedTypes?.createPolicy(\\"nextjs\\",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})||null),r)?.createScriptURL(e)||e}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"__unsafeCreateTrustedScriptURL\\",{enumerable:!0,get:function(){return n}}),(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7687:(e,t,r)=>{\\"use strict\\";function n(e,t){return e}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"removeLocale\\",{enumerable:!0,get:function(){return n}}),r(4625),(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7796:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"denormalizePagePath\\",{enumerable:!0,get:function(){return o}});let n=r(6928),a=r(3438);function o(e){let t=(0,a.normalizePathSep)(e);return t.startsWith(\\"/index/\\")&&!(0,n.isDynamicRoute)(t)?t.slice(6):\\"/index\\"!==t?t:\\"/\\"}},7804:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"isNextRouterError\\",{enumerable:!0,get:function(){return o}});let n=r(6780),a=r(9212);function o(e){return(0,a.isRedirectError)(e)||(0,n.isHTTPAccessFallbackError)(e)}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7832:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"parseLoaderTree\\",{enumerable:!0,get:function(){return a}});let n=r(9853);function a(e){let[t,r,a]=e,{layout:o,template:i}=a,{page:u}=a;u=t===n.DEFAULT_SEGMENT_KEY?a.defaultPage:u;let s=o?.[1]||i?.[1]||u?.[1];return{page:u,segment:t,modules:a,conventionPath:s,parallelRoutes:r}}},7855:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(8365)._(r(1577)),i=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||\\"\\",a=e.pathname||\\"\\",u=e.hash||\\"\\",s=e.query||\\"\\",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,\\":\\")+\\"@\\":\\"\\",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(\\":\\")?`[${r}]`:r),e.port&&(l+=\\":\\"+e.port)),s&&\\"object\\"==typeof s&&(s=String(o.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||\\"\\";return n&&!n.endsWith(\\":\\")&&(n+=\\":\\"),e.slashes||(!n||i.test(n))&&!1!==l?(l=\\"//\\"+(l||\\"\\"),a&&\\"/\\"!==a[0]&&(a=\\"/\\"+a)):l||(l=\\"\\"),u&&\\"#\\"!==u[0]&&(u=\\"#\\"+u),c&&\\"?\\"!==c[0]&&(c=\\"?\\"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace(\\"#\\",\\"%23\\"),`${n}${l}${a}${c}${u}`}let s=[\\"auth\\",\\"hash\\",\\"host\\",\\"hostname\\",\\"href\\",\\"path\\",\\"pathname\\",\\"port\\",\\"protocol\\",\\"query\\",\\"search\\",\\"slashes\\"];function l(e){return u(e)}},8166:(e,t)=>{\\"use strict\\";function r(e,t=\\"\\"){return(\\"/\\"===e?\\"/index\\":/^\\\\/index(\\\\/|$)/.test(e)?`/index${e}`:e)+t}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return r}})},8260:(e,t,r)=>{\\"use strict\\";function n(e){return e}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"removeBasePath\\",{enumerable:!0,get:function(){return n}}),r(9348),(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8365:(e,t,r)=>{\\"use strict\\";function n(e){if(\\"function\\"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||\\"object\\"!=typeof e&&\\"function\\"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var a={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(\\"default\\"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(a,i,u):a[i]=e[i]}return a.default=e,r&&r.set(e,a),a}r.r(t),r.d(t,{_:()=>a})},8452:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={HTML_LIMITED_BOT_UA_RE:function(){return o.HTML_LIMITED_BOT_UA_RE},HTML_LIMITED_BOT_UA_RE_STRING:function(){return u},getBotType:function(){return c},isBot:function(){return l}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6150),i=/Googlebot(?!-)|Googlebot$/i,u=o.HTML_LIMITED_BOT_UA_RE.source;function s(e){return o.HTML_LIMITED_BOT_UA_RE.test(e)}function l(e){return i.test(e)||s(e)}function c(e){return i.test(e)?\\"dom\\":s(e)?\\"html\\":void 0}},8659:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return d}});let n=r(4252),a=r(3467),o=r(8918),i=n._(r(8166)),u=r(1162),s=r(7380),l=r(4482),c=r(495),f=r(8945);r(4101);class d{constructor(e,t){this.routeLoader=(0,f.createRouteLoader)(t),this.buildId=e,this.assetPrefix=t,this.promisedSsgManifest=new Promise(e=>{window.__SSG_MANIFEST?e(window.__SSG_MANIFEST):window.__SSG_MANIFEST_CB=()=>{e(window.__SSG_MANIFEST)}})}getPageList(){return(0,f.getClientBuildManifest)().then(e=>e.sortedPages)}getMiddleware(){return window.__MIDDLEWARE_MATCHERS=[],window.__MIDDLEWARE_MATCHERS}getDataHref(e){var t;let r,{asPath:n,href:f,locale:d}=e,{pathname:p,query:h,search:_}=(0,l.parseRelativeUrl)(f),{pathname:m}=(0,l.parseRelativeUrl)(n),g=(0,c.removeTrailingSlash)(p);if(\\"/\\"!==g[0])throw Object.defineProperty(Error(`Route name should start with a \\"/\\", got \\"${g}\\"`),\\"__NEXT_ERROR_CODE\\",{value:\\"E303\\",enumerable:!1,configurable:!0});return t=e.skipInterpolation?m:(0,s.isDynamicRoute)(g)?(0,o.interpolateAs)(p,m,h).result:g,r=(0,i.default)((0,c.removeTrailingSlash)((0,u.addLocale)(t,d)),\\".json\\"),(0,a.addBasePath)(`/_next/data/${this.buildId}${r}${_}`,!0)}_isSsg(e){return this.promisedSsgManifest.then(t=>t.has(e))}loadPage(e){return this.routeLoader.loadRoute(e).then(e=>{if(\\"component\\"in e)return{page:e.component,mod:e.exports,styleSheets:e.styles.map(e=>({href:e.href,text:e.content}))};throw e.error})}prefetch(e){return this.routeLoader.prefetch(e)}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8757:(e,t)=>{\\"use strict\\";function r(){return\\"\\"}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"getDeploymentIdQueryOrEmptyString\\",{enumerable:!0,get:function(){return r}})},8912:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"warnOnce\\",{enumerable:!0,get:function(){return r}});let r=e=>{}},8918:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"interpolateAs\\",{enumerable:!0,get:function(){return o}});let n=r(5042),a=r(1591);function o(e,t,r){let o=\\"\\",i=(0,a.getRouteRegex)(e),u=i.groups,s=(t!==e?(0,n.getRouteMatcher)(i)(t):\\"\\")||r;o=e;let l=Object.keys(u);return l.every(e=>{let t=s[e]||\\"\\",{repeat:r,optional:n}=u[e],a=`[${r?\\"...\\":\\"\\"}${e}]`;return n&&(a=`${!t?\\"/\\":\\"\\"}[${a}]`),r&&!Array.isArray(t)&&(t=[t]),(n||e in s)&&(o=o.replace(a,r?t.map(e=>encodeURIComponent(e)).join(\\"/\\"):encodeURIComponent(t))||\\"/\\")})||(o=\\"\\"),{params:l,result:o}}},8945:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={createRouteLoader:function(){return E},getClientBuildManifest:function(){return m},isAssetError:function(){return d},markAssetError:function(){return f}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});r(4252),r(8166);let o=r(7657),i=r(2640),u=r(8757),s=r(39);function l(e,t,r){let n,a=t.get(e);if(a)return\\"future\\"in a?a.future:Promise.resolve(a);let o=new Promise(e=>{n=e});return t.set(e,{resolve:n,future:o}),r?r().then(e=>(n(e),e)).catch(r=>{throw t.delete(e),r}):o}let c=Symbol(\\"ASSET_LOAD_ERROR\\");function f(e){return Object.defineProperty(e,c,{})}function d(e){return e&&c in e}let p=function(e){try{return e=document.createElement(\\"link\\"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports(\\"prefetch\\")}catch{return!1}}(),h=()=>(0,u.getDeploymentIdQueryOrEmptyString)();function _(e,t,r){return new Promise((n,a)=>{let o=!1;e.then(e=>{o=!0,n(e)}).catch(a),(0,i.requestIdleCallback)(()=>setTimeout(()=>{o||a(r)},t))})}function m(){return self.__BUILD_MANIFEST?Promise.resolve(self.__BUILD_MANIFEST):_(new Promise(e=>{let t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}}),3800,f(Object.defineProperty(Error(\\"Failed to load client build manifest\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E273\\",enumerable:!1,configurable:!0})))}function g(e,t){return m().then(r=>{if(!(t in r))throw f(Object.defineProperty(Error(`Failed to lookup route: ${t}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E446\\",enumerable:!1,configurable:!0}));let n=r[t].map(t=>e+\\"/_next/\\"+(0,s.encodeURIPath)(t));return{scripts:n.filter(e=>e.endsWith(\\".js\\")).map(e=>(0,o.__unsafeCreateTrustedScriptURL)(e)+h()),css:n.filter(e=>e.endsWith(\\".css\\")).map(e=>e+h())}})}function E(e){let t=new Map,r=new Map,n=new Map,a=new Map;function o(e){{var t;let n=r.get(e.toString());return n?n:document.querySelector(`script[src^=\\"${e}\\"]`)?Promise.resolve():(r.set(e.toString(),n=new Promise((r,n)=>{(t=document.createElement(\\"script\\")).onload=r,t.onerror=()=>n(f(Object.defineProperty(Error(`Failed to load script: ${e}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E74\\",enumerable:!1,configurable:!0}))),t.crossOrigin=void 0,t.src=e,document.body.appendChild(t)})),n)}}function u(e){let t=n.get(e);return t||n.set(e,t=fetch(e,{credentials:\\"same-origin\\"}).then(t=>{if(!t.ok)throw Object.defineProperty(Error(`Failed to load stylesheet: ${e}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E189\\",enumerable:!1,configurable:!0});return t.text().then(t=>({href:e,content:t}))}).catch(e=>{throw f(e)})),t}return{whenEntrypoint:e=>l(e,t),onEntrypoint(e,r){(r?Promise.resolve().then(()=>r()).then(e=>({component:e&&e.default||e,exports:e}),e=>({error:e})):Promise.resolve(void 0)).then(r=>{let n=t.get(e);n&&\\"resolve\\"in n?r&&(t.set(e,r),n.resolve(r)):(r?t.set(e,r):t.delete(e),a.delete(e))})},loadRoute(r,n){return l(r,a,()=>{let a;return _(g(e,r).then(({scripts:e,css:n})=>Promise.all([t.has(r)?[]:Promise.all(e.map(o)),Promise.all(n.map(u))])).then(e=>this.whenEntrypoint(r).then(t=>({entrypoint:t,styles:e[1]}))),3800,f(Object.defineProperty(Error(`Route did not complete loading: ${r}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E12\\",enumerable:!1,configurable:!0}))).then(({entrypoint:e,styles:t})=>{let r=Object.assign({styles:t},e);return\\"error\\"in e?e:r}).catch(e=>{if(n)throw e;return{error:e}}).finally(()=>a?.())})},prefetch(t){let r;return(r=navigator.connection)&&(r.saveData||/2g/.test(r.effectiveType))?Promise.resolve():g(e,t).then(e=>Promise.all(p?e.scripts.map(e=>{var t,r,n;return t=e.toString(),r=\\"script\\",new Promise((e,a)=>{let o=`\\n link[rel=\\"prefetch\\"][href^=\\"${t}\\"],\\n link[rel=\\"preload\\"][href^=\\"${t}\\"],\\n script[src^=\\"${t}\\"]`;if(document.querySelector(o))return e();n=document.createElement(\\"link\\"),r&&(n.as=r),n.rel=\\"prefetch\\",n.crossOrigin=void 0,n.onload=e,n.onerror=()=>a(f(Object.defineProperty(Error(`Failed to prefetch: ${t}`),\\"__NEXT_ERROR_CODE\\",{value:\\"E268\\",enumerable:!1,configurable:!0}))),n.href=t,document.head.appendChild(n)})}):[])).then(()=>{(0,i.requestIdleCallback)(()=>this.loadRoute(t,!0).catch(()=>{}))}).catch(()=>{})}}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9046:(e,t)=>{\\"use strict\\";function r(){let e=Object.create(null);return{on(t,r){(e[t]||(e[t]=[])).push(r)},off(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit(t,...r){(e[t]||[]).slice().map(e=>{e(...r)})}}}Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return r}})},9212:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n,a={REDIRECT_ERROR_CODE:function(){return u},RedirectType:function(){return s},isRedirectError:function(){return l}};for(var o in a)Object.defineProperty(t,o,{enumerable:!0,get:a[o]});let i=r(7258),u=\\"NEXT_REDIRECT\\";var s=((n={}).push=\\"push\\",n.replace=\\"replace\\",n);function l(e){if(\\"object\\"!=typeof e||null===e||!(\\"digest\\"in e)||\\"string\\"!=typeof e.digest)return!1;let t=e.digest.split(\\";\\"),[r,n]=t,a=t.slice(2,-2).join(\\";\\"),o=Number(t.at(-2));return r===u&&(\\"replace\\"===n||\\"push\\"===n)&&\\"string\\"==typeof a&&!isNaN(o)&&o in i.RedirectStatusCode}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9308:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={ACTION_SUFFIX:function(){return m},APP_DIR_ALIAS:function(){return $},CACHE_ONE_YEAR:function(){return j},DOT_NEXT_ALIAS:function(){return D},ESLINT_DEFAULT_DIRS:function(){return ea},GSP_NO_RETURNED_VALUE:function(){return J},GSSP_COMPONENT_MEMBER_ERROR:function(){return et},GSSP_NO_RETURNED_VALUE:function(){return Z},HTML_CONTENT_TYPE_HEADER:function(){return o},INFINITE_CACHE:function(){return N},INSTRUMENTATION_HOOK_FILENAME:function(){return M},JSON_CONTENT_TYPE_HEADER:function(){return i},MATCHED_PATH_HEADER:function(){return l},MIDDLEWARE_FILENAME:function(){return w},MIDDLEWARE_LOCATION_REGEXP:function(){return C},NEXT_BODY_SUFFIX:function(){return y},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return A},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return b},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return R},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return T},NEXT_CACHE_TAGS_HEADER:function(){return P},NEXT_CACHE_TAG_MAX_ITEMS:function(){return O},NEXT_CACHE_TAG_MAX_LENGTH:function(){return S},NEXT_DATA_SUFFIX:function(){return g},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return s},NEXT_META_SUFFIX:function(){return E},NEXT_QUERY_PARAM_PREFIX:function(){return u},NEXT_RESUME_HEADER:function(){return v},NON_STANDARD_NODE_ENV:function(){return er},PAGES_DIR_ALIAS:function(){return L},PRERENDER_REVALIDATE_HEADER:function(){return c},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return f},PROXY_FILENAME:function(){return I},PROXY_LOCATION_REGEXP:function(){return x},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return q},ROOT_DIR_ALIAS:function(){return U},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return G},RSC_ACTION_ENCRYPTION_ALIAS:function(){return W},RSC_ACTION_PROXY_ALIAS:function(){return B},RSC_ACTION_VALIDATE_ALIAS:function(){return k},RSC_CACHE_WRAPPER_ALIAS:function(){return H},RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS:function(){return X},RSC_MOD_REF_PROXY_ALIAS:function(){return F},RSC_PREFETCH_SUFFIX:function(){return d},RSC_SEGMENTS_DIR_SUFFIX:function(){return p},RSC_SEGMENT_SUFFIX:function(){return h},RSC_SUFFIX:function(){return _},SERVER_PROPS_EXPORT_ERROR:function(){return Q},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return Y},SERVER_PROPS_SSG_CONFLICT:function(){return V},SERVER_RUNTIME:function(){return eo},SSG_FALLBACK_EXPORT_ERROR:function(){return en},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return z},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return K},TEXT_PLAIN_CONTENT_TYPE_HEADER:function(){return a},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return ee},WEBPACK_LAYERS:function(){return es},WEBPACK_RESOURCE_QUERIES:function(){return el},WEB_SOCKET_MAX_RECONNECTIONS:function(){return ei}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=\\"text/plain\\",o=\\"text/html; charset=utf-8\\",i=\\"application/json; charset=utf-8\\",u=\\"nxtP\\",s=\\"nxtI\\",l=\\"x-matched-path\\",c=\\"x-prerender-revalidate\\",f=\\"x-prerender-revalidate-if-generated\\",d=\\".prefetch.rsc\\",p=\\".segments\\",h=\\".segment.rsc\\",_=\\".rsc\\",m=\\".action\\",g=\\".json\\",E=\\".meta\\",y=\\".body\\",P=\\"x-next-cache-tags\\",b=\\"x-next-revalidated-tags\\",R=\\"x-next-revalidate-tag-token\\",v=\\"next-resume\\",O=128,S=256,T=1024,A=\\"_N_T_\\",j=31536e3,N=0xfffffffe,w=\\"middleware\\",C=`(?:src/)?${w}`,I=\\"proxy\\",x=`(?:src/)?${I}`,M=\\"instrumentation\\",L=\\"private-next-pages\\",D=\\"private-dot-next\\",U=\\"private-next-root-dir\\",$=\\"private-next-app-dir\\",F=\\"private-next-rsc-mod-ref-proxy\\",k=\\"private-next-rsc-action-validate\\",B=\\"private-next-rsc-server-reference\\",H=\\"private-next-rsc-cache-wrapper\\",X=\\"private-next-rsc-track-dynamic-import\\",W=\\"private-next-rsc-action-encryption\\",G=\\"private-next-rsc-action-client-wrapper\\",q=\\"You can not have a \'_next\' folder inside of your public folder. This conflicts with the internal \'/_next\' route. https://nextjs.org/docs/messages/public-next-folder-conflict\\",z=\\"You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps\\",Y=\\"You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.\\",V=\\"You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps\\",K=\\"can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props\\",Q=\\"pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export\\",J=\\"Your `getStaticProps` function did not return an object. Did you forget to add a `return`?\\",Z=\\"Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?\\",ee=\\"The `unstable_revalidate` property is available for general use.\\\\nPlease use `revalidate` instead.\\",et=\\"can not be attached to a page\'s component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member\\",er=\'You are using a non-standard \\"NODE_ENV\\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env\',en=\\"Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export\\",ea=[\\"app\\",\\"pages\\",\\"components\\",\\"lib\\",\\"src\\"],eo={edge:\\"edge\\",experimentalEdge:\\"experimental-edge\\",nodejs:\\"nodejs\\"},ei=12,eu={shared:\\"shared\\",reactServerComponents:\\"rsc\\",serverSideRendering:\\"ssr\\",actionBrowser:\\"action-browser\\",apiNode:\\"api-node\\",apiEdge:\\"api-edge\\",middleware:\\"middleware\\",instrument:\\"instrument\\",edgeAsset:\\"edge-asset\\",appPagesBrowser:\\"app-pages-browser\\",pagesDirBrowser:\\"pages-dir-browser\\",pagesDirEdge:\\"pages-dir-edge\\",pagesDirNode:\\"pages-dir-node\\"},es={...eu,GROUP:{builtinReact:[eu.reactServerComponents,eu.actionBrowser],serverOnly:[eu.reactServerComponents,eu.actionBrowser,eu.instrument,eu.middleware],neutralTarget:[eu.apiNode,eu.apiEdge],clientOnly:[eu.serverSideRendering,eu.appPagesBrowser],bundled:[eu.reactServerComponents,eu.actionBrowser,eu.serverSideRendering,eu.appPagesBrowser,eu.shared,eu.instrument,eu.middleware],appPages:[eu.reactServerComponents,eu.serverSideRendering,eu.appPagesBrowser,eu.actionBrowser]}},el={edgeSSREntry:\\"__next_edge_ssr_entry__\\",metadata:\\"__next_metadata__\\",metadataRoute:\\"__next_metadata_route__\\",metadataImageMeta:\\"__next_metadata_image_meta__\\"}},9313:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={DecodeError:function(){return m},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return y},NormalizeError:function(){return g},PageNotFoundError:function(){return E},SP:function(){return h},ST:function(){return _},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return s},getURL:function(){return l},isAbsoluteUrl:function(){return u},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return d},stringifyError:function(){return b}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=[\\"CLS\\",\\"FCP\\",\\"FID\\",\\"INP\\",\\"LCP\\",\\"TTFB\\"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\\\\d+\\\\-.]*?:/,u=e=>i.test(e);function s(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?\\":\\"+r:\\"\\"}`}function l(){let{href:e}=window.location,t=s();return e.substring(t.length)}function c(e){return\\"string\\"==typeof e?e:e.displayName||e.name||\\"Unknown\\"}function f(e){return e.finished||e.headersSent}function d(e){let t=e.split(\\"?\\");return t[0].replace(/\\\\\\\\/g,\\"/\\").replace(/\\\\/\\\\/+/g,\\"/\\")+(t[1]?`?${t.slice(1).join(\\"?\\")}`:\\"\\")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`\\"${c(e)}.getInitialProps()\\" should resolve to an object. But found \\"${n}\\" instead.`),\\"__NEXT_ERROR_CODE\\",{value:\\"E394\\",enumerable:!1,configurable:!0});return n}let h=\\"undefined\\"!=typeof performance,_=h&&[\\"mark\\",\\"measure\\",\\"getEntriesByName\\"].every(e=>\\"function\\"==typeof performance[e]);class m extends Error{}class g extends Error{}class E extends Error{constructor(e){super(),this.code=\\"ENOENT\\",this.name=\\"PageNotFoundError\\",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class P extends Error{constructor(){super(),this.code=\\"ENOENT\\",this.message=\\"Cannot find the middleware module\\"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},9348:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"hasBasePath\\",{enumerable:!0,get:function(){return a}});let n=r(921);function a(e){return(0,n.pathHasPrefix)(e,\\"\\")}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9393:()=>{},9509:e=>{(()=>{\\"use strict\\";\\"undefined\\"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=\\"//\\");var t={};(()=>{function e(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||95===i){a+=e[o++];continue}break}if(!a)throw TypeError(\\"Missing parameter name at \\".concat(r));t.push({type:\\"NAME\\",index:r,value:a}),r=o;continue}if(\\"(\\"===n){var u=1,s=\\"\\",o=r+1;if(\\"?\\"===e[o])throw TypeError(\'Pattern cannot start with \\"?\\" at \'.concat(o));for(;o-1)return!0}return!1},m=function(e){var t=s[s.length-1],r=e||(t&&\\"string\\"==typeof t?t:\\"\\");if(t&&!r)throw TypeError(\'Must have text between two parameters, missing text after \\"\'.concat(t.name,\'\\"\'));return!r||_(r)?\\"[^\\".concat(a(u),\\"]+?\\"):\\"(?:(?!\\".concat(a(r),\\")[^\\").concat(a(u),\\"])+?\\")};c-1:void 0===b;i||(_+=\\"(?:\\".concat(h,\\"(?=\\").concat(p,\\"))?\\")),R||(_+=\\"(?=\\".concat(h,\\"|\\").concat(p,\\")\\"))}return new RegExp(_,o(r))}function u(t,r,n){if(t instanceof RegExp){var a;if(!r)return t;for(var s=/\\\\((?:\\\\?<(.*?)>)?(?!\\\\?)/g,l=0,c=s.exec(t.source);c;)r.push({name:c[1]||l++,prefix:\\"\\",suffix:\\"\\",modifier:\\"\\",pattern:\\"\\"}),c=s.exec(t.source);return t}return Array.isArray(t)?(a=t.map(function(e){return u(e,r,n).source}),new RegExp(\\"(?:\\".concat(a.join(\\"|\\"),\\")\\"),o(n))):i(e(t,n),r,n)}Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.pathToRegexp=t.tokensToRegexp=t.regexpToFunction=t.match=t.tokensToFunction=t.compile=t.parse=void 0,t.parse=e,t.compile=function(t,n){return r(e(t,n),n)},t.tokensToFunction=r,t.match=function(e,t){var r=[];return n(u(e,r,t),r,t)},t.regexpToFunction=n,t.tokensToRegexp=i,t.pathToRegexp=u})(),e.exports=t})()},9603:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var n={Router:function(){return u.default},createRouter:function(){return g},default:function(){return _},makePublicRouterInstance:function(){return E},useRouter:function(){return m},withRouter:function(){return c.default}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(4252),i=o._(r(4232)),u=o._(r(1699)),s=r(5067),l=o._(r(6240)),c=o._(r(4504)),f={router:null,readyCallbacks:[],ready(e){if(this.router)return e();this.readyCallbacks.push(e)}},d=[\\"pathname\\",\\"route\\",\\"query\\",\\"asPath\\",\\"components\\",\\"isFallback\\",\\"basePath\\",\\"locale\\",\\"locales\\",\\"defaultLocale\\",\\"isReady\\",\\"isPreview\\",\\"isLocaleDomain\\",\\"domainLocales\\"],p=[\\"push\\",\\"replace\\",\\"reload\\",\\"back\\",\\"prefetch\\",\\"beforePopState\\"];function h(){if(!f.router)throw Object.defineProperty(Error(\'No router instance found.\\\\nYou should only use \\"next/router\\" on the client side of your app.\\\\n\'),\\"__NEXT_ERROR_CODE\\",{value:\\"E394\\",enumerable:!1,configurable:!0});return f.router}Object.defineProperty(f,\\"events\\",{get:()=>u.default.events}),d.forEach(e=>{Object.defineProperty(f,e,{get:()=>h()[e]})}),p.forEach(e=>{f[e]=(...t)=>h()[e](...t)}),[\\"routeChangeStart\\",\\"beforeHistoryChange\\",\\"routeChangeComplete\\",\\"routeChangeError\\",\\"hashChangeStart\\",\\"hashChangeComplete\\"].forEach(e=>{f.ready(()=>{u.default.events.on(e,(...t)=>{let r=`on${e.charAt(0).toUpperCase()}${e.substring(1)}`;if(f[r])try{f[r](...t)}catch(e){console.error(`Error when running the Router event: ${r}`),console.error((0,l.default)(e)?`${e.message}\\n${e.stack}`:e+\\"\\")}})})});let _=f;function m(){let e=i.default.useContext(s.RouterContext);if(!e)throw Object.defineProperty(Error(\\"NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E509\\",enumerable:!1,configurable:!0});return e}function g(...e){return f.router=new u.default(...e),f.readyCallbacks.forEach(e=>e()),f.readyCallbacks=[],f.router}function E(e){let t={};for(let r of d){if(\\"object\\"==typeof e[r]){t[r]=Object.assign(Array.isArray(e[r])?[]:{},e[r]);continue}t[r]=e[r]}return t.events=u.default.events,p.forEach(r=>{t[r]=(...t)=>e[r](...t)}),t}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9853:(e,t)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={DEFAULT_SEGMENT_KEY:function(){return c},PAGE_SEGMENT_KEY:function(){return l},addSearchParamsIfPageSegment:function(){return u},computeSelectedLayoutSegment:function(){return s},getSegmentValue:function(){return a},getSelectedLayoutSegmentPath:function(){return function e(t,r,n=!0,o=[]){let i;if(n)i=t[1][r];else{let e=t[1];i=e.children??Object.values(e)[0]}if(!i)return o;let u=a(i[0]);return!u||u.startsWith(l)?o:(o.push(u),e(i,r,!1,o))}},isGroupSegment:function(){return o},isParallelRouteSegment:function(){return i}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});function a(e){return Array.isArray(e)?e[1]:e}function o(e){return\\"(\\"===e[0]&&e.endsWith(\\")\\")}function i(e){return e.startsWith(\\"@\\")&&\\"@children\\"!==e}function u(e,t){if(e.includes(l)){let e=JSON.stringify(t);return\\"{}\\"!==e?l+\\"?\\"+e:l}return e}function s(e,t){if(!e||0===e.length)return null;let r=\\"children\\"===t?e[0]:e[e.length-1];return r===c?null:r}let l=\\"__PAGE__\\",c=\\"__DEFAULT__\\"},9895:(e,t,r)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),r(2117),r(7647);let n=r(9930);window.next={version:n.version,get router(){return n.router},emitter:n.emitter},(0,n.initialize)({}).then(()=>(0,n.hydrate)()).catch(console.error),(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9930:(e,t,r)=>{\\"use strict\\";let n,a,o,i,u,s,l,c,f,d,p,h;Object.defineProperty(t,\\"__esModule\\",{value:!0});var _={emitter:function(){return H},hydrate:function(){return ep},initialize:function(){return q},router:function(){return n},version:function(){return B}};for(var m in _)Object.defineProperty(t,m,{enumerable:!0,get:_[m]});let g=r(4252),E=r(7876);r(1291);let y=g._(r(4232)),P=g._(r(8944)),b=r(6972),R=g._(r(9046)),v=r(5067),O=r(5481),S=r(7380),T=r(1577),A=r(9313),j=r(807),N=g._(r(1714)),w=g._(r(8659)),C=r(5737),I=r(9603),x=r(6240),M=r(5526),L=r(8260),D=r(9348),U=r(1965),$=r(2234),F=r(760),k=r(2404);r(1792),r(7804);let B=\\"16.0.5\\",H=(0,R.default)(),X=e=>[].slice.call(e),W=!1;class G extends y.default.Component{componentDidCatch(e,t){this.props.fn(e,t)}componentDidMount(){this.scrollToHash(),n.isSsr&&(a.isFallback||a.nextExport&&((0,S.isDynamicRoute)(n.pathname)||location.search||W)||a.props&&a.props.__N_SSG&&(location.search||W))&&n.replace(n.pathname+\\"?\\"+String((0,T.assign)((0,T.urlQueryToSearchParams)(n.query),new URLSearchParams(location.search))),o,{_h:1,shallow:!a.isFallback&&!W}).catch(e=>{if(!e.cancelled)throw e})}componentDidUpdate(){this.scrollToHash()}scrollToHash(){let{hash:e}=location;if(!(e=e&&e.substring(1)))return;let t=document.getElementById(e);t&&setTimeout(()=>t.scrollIntoView(),0)}render(){return this.props.children}}async function q(e={}){a=JSON.parse(document.getElementById(\\"__NEXT_DATA__\\").textContent),window.__NEXT_DATA__=a,h=a.defaultLocale;let t=a.assetPrefix||\\"\\";if(self.__next_set_public_path__(`${t}/_next/`),o=(0,A.getURL)(),(0,D.hasBasePath)(o)&&(o=(0,L.removeBasePath)(o)),a.scriptLoader){let{initScriptLoader:e}=r(3209);e(a.scriptLoader)}i=new w.default(a.buildId,t);let l=([e,t])=>i.routeLoader.onEntrypoint(e,t);return window.__NEXT_P&&window.__NEXT_P.map(e=>setTimeout(()=>l(e),0)),window.__NEXT_P=[],window.__NEXT_P.push=l,(s=(0,N.default)()).getIsSsr=()=>n.isSsr,u=document.getElementById(\\"__next\\"),{assetPrefix:t}}function z(e,t){return(0,E.jsx)(e,{...t})}function Y({children:e}){let t=y.default.useMemo(()=>(0,$.adaptForAppRouterInstance)(n),[]);return(0,E.jsx)(G,{fn:e=>K({App:f,err:e}).catch(e=>console.error(\\"Error rendering page: \\",e)),children:(0,E.jsx)(U.AppRouterContext.Provider,{value:t,children:(0,E.jsx)(F.SearchParamsContext.Provider,{value:(0,$.adaptForSearchParams)(n),children:(0,E.jsx)($.PathnameContextProviderAdapter,{router:n,isAutoExport:self.__NEXT_DATA__.autoExport??!1,children:(0,E.jsx)(F.PathParamsContext.Provider,{value:(0,$.adaptForPathParams)(n),children:(0,E.jsx)(v.RouterContext.Provider,{value:(0,I.makePublicRouterInstance)(n),children:(0,E.jsx)(b.HeadManagerContext.Provider,{value:s,children:(0,E.jsx)(M.ImageConfigContext.Provider,{value:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:\\"/_next/image\\",loader:\\"default\\",dangerouslyAllowSVG:!1,unoptimized:!0},children:e})})})})})})})})}let V=e=>t=>{let r={...t,Component:p,err:a.err,router:n};return(0,E.jsx)(Y,{children:z(e,r)})};function K(e){let{App:t,err:u}=e;return console.error(u),console.error(\\"A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred\\"),i.loadPage(\\"/_error\\").then(({page:n,styleSheets:a})=>l?.Component===n?r.e(494).then(r.t.bind(r,5494,23)).then(n=>r.e(763).then(r.t.bind(r,8763,23)).then(r=>(e.App=t=r.default,n))).then(e=>({ErrorComponent:e.default,styleSheets:[]})):{ErrorComponent:n,styleSheets:a}).then(({ErrorComponent:r,styleSheets:i})=>{let s=V(t),l={Component:r,AppTree:s,router:n,ctx:{err:u,pathname:a.page,query:a.query,asPath:o,AppTree:s}};return Promise.resolve(e.props?.err?e.props:(0,A.loadGetInitialProps)(t,l)).then(t=>ef({...e,err:u,Component:r,styleSheets:i,props:t}))})}function Q({callback:e}){return y.default.useLayoutEffect(()=>e(),[e]),null}let J=\\"beforeRender\\",Z=\\"afterRender\\",ee=\\"afterHydrate\\",et=\\"routeChange\\",er=\\"Next.js-hydration\\",en=\\"Next.js-route-change-to-render\\",ea=\\"Next.js-render\\",eo=null,ei=!0;function eu(){[J,ee,Z,et].forEach(e=>performance.clearMarks(e))}function es(){A.ST&&(performance.mark(ee),performance.getEntriesByName(J,\\"mark\\").length&&(performance.measure(\\"Next.js-before-hydration\\",\\"navigationStart\\",J),performance.measure(er,J,ee)),d&&performance.getEntriesByName(er).forEach(d),eu())}function el(){if(!A.ST)return;performance.mark(Z);let e=performance.getEntriesByName(et,\\"mark\\");e.length&&(performance.getEntriesByName(J,\\"mark\\").length&&(performance.measure(en,e[0].name,J),performance.measure(ea,J,Z),d&&(performance.getEntriesByName(ea).forEach(d),performance.getEntriesByName(en).forEach(d))),eu(),[en,ea].forEach(e=>performance.clearMeasures(e)))}function ec({callbacks:e,children:t}){return y.default.useLayoutEffect(()=>e.forEach(e=>e()),[e]),t}function ef(e){var t,r;let a,o,{App:i,Component:s,props:f,err:d}=e,p=\\"initial\\"in e?void 0:e.styleSheets;s=s||l.Component;let h={...f=f||l.props,Component:s,err:d,router:n};l=h;let _=!1,m=new Promise((e,t)=>{c&&c(),o=()=>{c=null,e()},c=()=>{_=!0,c=null;let e=Object.defineProperty(Error(\\"Cancel rendering route\\"),\\"__NEXT_ERROR_CODE\\",{value:\\"E503\\",enumerable:!1,configurable:!0});e.cancelled=!0,t(e)}});function g(){o()}!function(){if(!p)return;let e=new Set(X(document.querySelectorAll(\\"style[data-n-href]\\")).map(e=>e.getAttribute(\\"data-n-href\\"))),t=document.querySelector(\\"noscript[data-n-css]\\"),r=t?.getAttribute(\\"data-n-css\\");p.forEach(({href:t,text:n})=>{if(!e.has(t)){let e=document.createElement(\\"style\\");e.setAttribute(\\"data-n-href\\",t),e.setAttribute(\\"media\\",\\"x\\"),r&&e.setAttribute(\\"nonce\\",r),document.head.appendChild(e),e.appendChild(document.createTextNode(n))}})}();let b=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Q,{callback:function(){if(p&&!_){let e=new Set(p.map(e=>e.href)),t=X(document.querySelectorAll(\\"style[data-n-href]\\")),r=t.map(e=>e.getAttribute(\\"data-n-href\\"));for(let n=0;n{let t=document.querySelector(`style[data-n-href=\\"${e}\\"]`);t&&(n.parentNode.insertBefore(t,n.nextSibling),n=t)}),X(document.querySelectorAll(\\"link[data-n-p]\\")).forEach(e=>{e.parentNode.removeChild(e)})}if(e.scroll){let{x:t,y:r}=e.scroll;(0,O.disableSmoothScrollDuringRouteTransition)(()=>{window.scrollTo(t,r)})}}}),(0,E.jsxs)(Y,{children:[z(i,h),(0,E.jsx)(j.Portal,{type:\\"next-route-announcer\\",children:(0,E.jsx)(C.RouteAnnouncer,{})})]})]});return t=u,r=e=>(0,E.jsx)(ec,{callbacks:[e,g],children:b}),A.ST&&performance.mark(J),a=r(ei?es:el),eo?(0,y.default.startTransition)(()=>{eo.render(a)}):(eo=P.default.hydrateRoot(t,a,{onRecoverableError:k.onRecoverableError}),ei=!1),m}async function ed(e){if(e.err&&(void 0===e.Component||!e.isHydratePass))return void await K(e);try{await ef(e)}catch(r){let t=(0,x.getProperError)(r);if(t.cancelled)throw t;await K({...e,err:t})}}async function ep(e){let t=a.err;try{let e=await i.routeLoader.whenEntrypoint(\\"/_app\\");if(\\"error\\"in e)throw e.error;let{component:t,exports:r}=e;f=t,r&&r.reportWebVitals&&(d=({id:e,name:t,startTime:n,value:a,duration:o,entryType:i,entries:u,attribution:s})=>{let l,c=`${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`;u&&u.length&&(l=u[0].startTime);let f={id:e||c,name:t,startTime:n||l,value:null==a?o:a,label:\\"mark\\"===i||\\"measure\\"===i?\\"custom\\":\\"web-vital\\"};s&&(f.attribution=s),r.reportWebVitals(f)});let n=await i.routeLoader.whenEntrypoint(a.page);if(\\"error\\"in n)throw n.error;p=n.component}catch(e){t=(0,x.getProperError)(e)}window.__NEXT_PRELOADREADY&&await window.__NEXT_PRELOADREADY(a.dynamicIds),n=(0,I.createRouter)(a.page,a.query,o,{initialProps:a.props,pageLoader:i,App:f,Component:p,wrapApp:V,err:t,isFallback:!!a.isFallback,subscription:(e,t,r)=>ed(Object.assign({},e,{App:t,scroll:r})),locale:a.locale,locales:a.locales,defaultLocale:h,domainLocales:a.domainLocales,isPreview:a.isPreview}),W=await n._initialMatchesMiddlewarePromise;let r={App:f,initial:!0,Component:p,props:a.props,err:t,isHydratePass:!0};e?.beforeRender&&await e.beforeRender(),ed(r)}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[593],()=>e(e.s=9895)),_N_E=e.O()}]);"},{"name":"absences-5726e3e6753ac41c.js","path":"apps/web/out/_next/static/chunks/pages/admin/absences-5726e3e6753ac41c.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[108],{1892:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/absences\\",function(){return a(9577)}])},8753:(e,s,a)=>{\\"use strict\\";a.d(s,{A:()=>w});var t=a(7876);a(4232);var l=a(8230),n=a.n(l),i=a(9099),r=a(9423),o=a(8264),d=a(5201),c=a(9065),x=a(1538),h=a(4763),m=a(4560),p=a(8423),b=a(6068),u=a(5164),f=a(4302),v=a(3657),j=a(7932),g=a(6647);function N(){let e=(0,i.useRouter)(),{clients:s,selectedClientId:a,setClient:l}=(0,g.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:r.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:h.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:p.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:b.A,label:\\"Usuarios Sistema\\"}]}];return(0,t.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,t.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,t.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,t.jsxs)(\\"select\\",{value:a,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),s.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,t.jsx)(u.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,t.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,t.jsx)(n(),{href:\\"/admin/home\\",children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,t.jsx)(f.A,{size:18}),\\" Inicio\\"]})}),N.map(s=>(0,t.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,t.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:s.title}),s.items.map(s=>(0,t.jsx)(n(),{href:s.href,children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===s.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,t.jsx)(s.icon,{size:16}),\\" \\",s.label]})},s.href))]},s.title))]}),(0,t.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,t.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,t.jsx)(v.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function w({children:e,title:s}){return(0,t.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,t.jsx)(N,{}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,t.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,t.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:s})}),(0,t.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,t.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9577:(e,s,a)=>{\\"use strict\\";a.r(s),a.d(s,{default:()=>n});var t=a(7876);a(4232);var l=a(8753);function n(){return(0,t.jsx)(l.A,{title:\\"Gesti\\\\xf3n de Ausencias\\",children:(0,t.jsx)(\\"div\\",{className:\\"bg-white p-10 rounded-[2.5rem] shadow-sm border border-slate-100\\",children:(0,t.jsx)(\\"p\\",{className:\\"text-slate-500\\",children:\\"M\\\\xf3dulo restaurado. Cargando datos...\\"})})})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=1892)),_N_E=e.O()}]);"},{"name":"audit-e2865bcee48bd6aa.js","path":"apps/web/out/_next/static/chunks/pages/admin/audit-e2865bcee48bd6aa.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[669],{6410:(e,t,s)=>{\\"use strict\\";s.r(t),s.d(t,{default:()=>m});var a=s(7876);s(4232);var l=s(8753),i=s(7914),r=s(7932),n=s(6647),c=s(7161);let d=(0,c.A)(\\"shield\\",[[\\"path\\",{d:\\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\\",key:\\"oel41y\\"}]]);var o=s(7104);let x=(0,c.A)(\\"user\\",[[\\"path\\",{d:\\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\\",key:\\"975kel\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"7\\",r:\\"4\\",key:\\"17ys0d\\"}]]);var h=s(8423);function m(){let{data:e=[],isLoading:t}=function(e){let{selectedClientId:t}=(0,n.t)();return(0,i.I)({queryKey:[\\"audit-logs\\",t,e],queryFn:async()=>{console.log(\\"\\\\uD83D\\\\uDEF0️ Enviando petici\\\\xf3n de Auditor\\\\xeda para Cliente:\\",t);try{let s=await (0,r.callManageAudits)({action:\\"GET_LOGS\\",payload:{...e,clientId:t}});console.log(\\"\\\\uD83D\\\\uDCE5 Respuesta recibida:\\",s);let a=s?.data?.data||s?.data||s||[];return Array.isArray(a)?a:[]}catch(e){return console.error(\\"❌ Error cr\\\\xedtico en Auditor\\\\xeda:\\",e),[]}},enabled:!!t})}({limit:50});return(0,a.jsx)(l.A,{title:\\"Auditor\\\\xeda de Sistema\\",children:(0,a.jsxs)(\\"div\\",{className:\\"bg-white rounded-[2.5rem] shadow-sm border border-slate-100 overflow-hidden\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"p-8 border-b border-slate-50 flex items-center justify-between bg-slate-50/50\\",children:[(0,a.jsxs)(\\"div\\",{children:[(0,a.jsx)(\\"h2\\",{className:\\"text-xl font-bold text-slate-800\\",children:\\"Registros de Actividad\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-sm text-slate-500\\",children:\\"Historial completo de acciones realizadas en la plataforma\\"})]}),(0,a.jsxs)(\\"div\\",{className:\\"px-4 py-2 bg-indigo-50 text-indigo-600 rounded-xl text-xs font-bold flex items-center gap-2\\",children:[(0,a.jsx)(d,{size:14}),\\" \\",e.length,\\" Registros\\"]})]}),(0,a.jsx)(\\"div\\",{className:\\"overflow-x-auto\\",children:(0,a.jsxs)(\\"table\\",{className:\\"w-full text-left border-collapse\\",children:[(0,a.jsx)(\\"thead\\",{children:(0,a.jsxs)(\\"tr\\",{className:\\"bg-slate-50/50\\",children:[(0,a.jsx)(\\"th\\",{className:\\"px-8 py-4 text-[10px] font-black text-slate-400 uppercase tracking-widest\\",children:\\"Fecha / Hora\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-8 py-4 text-[10px] font-black text-slate-400 uppercase tracking-widest\\",children:\\"Usuario\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-8 py-4 text-[10px] font-black text-slate-400 uppercase tracking-widest\\",children:\\"Acci\\\\xf3n\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-8 py-4 text-[10px] font-black text-slate-400 uppercase tracking-widest\\",children:\\"M\\\\xf3dulo\\"})]})}),(0,a.jsx)(\\"tbody\\",{className:\\"divide-y divide-slate-50\\",children:t?(0,a.jsx)(\\"tr\\",{children:(0,a.jsx)(\\"td\\",{colSpan:4,className:\\"px-8 py-12 text-center text-slate-400 animate-pulse\\",children:\\"Cargando registros de auditor\\\\xeda...\\"})}):0===e.length?(0,a.jsx)(\\"tr\\",{children:(0,a.jsx)(\\"td\\",{colSpan:4,className:\\"px-8 py-12 text-center text-slate-400\\",children:\\"No se encontraron registros de actividad\\"})}):e.map((e,t)=>(0,a.jsxs)(\\"tr\\",{className:\\"hover:bg-slate-50/50 transition-colors\\",children:[(0,a.jsx)(\\"td\\",{className:\\"px-8 py-4 text-sm text-slate-600 font-medium\\",children:(0,a.jsxs)(\\"div\\",{className:\\"flex items-center gap-2\\",children:[(0,a.jsx)(o.A,{size:14,className:\\"text-slate-300\\"}),\\" \\",e.timestampIso||\\"---\\"]})}),(0,a.jsx)(\\"td\\",{className:\\"px-8 py-4 text-sm text-slate-800 font-bold\\",children:(0,a.jsxs)(\\"div\\",{className:\\"flex items-center gap-2\\",children:[(0,a.jsx)(x,{size:14,className:\\"text-indigo-400\\"}),\\" \\",e.changedBy||\\"Sistema\\"]})}),(0,a.jsx)(\\"td\\",{className:\\"px-8 py-4\\",children:(0,a.jsx)(\\"span\\",{className:\\"px-3 py-1 bg-slate-100 text-slate-600 rounded-lg text-[10px] font-black uppercase tracking-tighter\\",children:e.action})}),(0,a.jsx)(\\"td\\",{className:\\"px-8 py-4 text-sm text-slate-500\\",children:(0,a.jsxs)(\\"div\\",{className:\\"flex items-center gap-2\\",children:[(0,a.jsx)(h.A,{size:14,className:\\"text-slate-300\\"}),\\" \\",e.module||\\"General\\"]})})]},t))})]})})]})})}},7104:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>a});let a=(0,s(7161).A)(\\"clock\\",[[\\"path\\",{d:\\"M12 6v6l4 2\\",key:\\"mmk7yg\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}]])},8753:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>y});var a=s(7876);s(4232);var l=s(8230),i=s.n(l),r=s(9099),n=s(9423),c=s(8264),d=s(5201),o=s(9065),x=s(1538),h=s(4763),m=s(4560),p=s(8423),u=s(6068),b=s(5164),f=s(4302),j=s(3657),g=s(7932),N=s(6647);function v(){let e=(0,r.useRouter)(),{clients:t,selectedClientId:s,setClient:l}=(0,N.t)(),v=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:c.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:o.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:h.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:p.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:u.A,label:\\"Usuarios Sistema\\"}]}];return(0,a.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,a.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,a.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,a.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,a.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,a.jsxs)(\\"select\\",{value:s,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,a.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),t.map(e=>(0,a.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,a.jsx)(b.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,a.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,a.jsx)(i(),{href:\\"/admin/home\\",children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,a.jsx)(f.A,{size:18}),\\" Inicio\\"]})}),v.map(t=>(0,a.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,a.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:t.title}),t.items.map(t=>(0,a.jsx)(i(),{href:t.href,children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===t.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,a.jsx)(t.icon,{size:16}),\\" \\",t.label]})},t.href))]},t.title))]}),(0,a.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,a.jsxs)(\\"button\\",{onClick:()=>g.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,a.jsx)(j.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function y({children:e,title:t}){return(0,a.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,a.jsx)(v,{}),(0,a.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,a.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,a.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:t})}),(0,a.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,a.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9377:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/audit\\",function(){return s(6410)}])}},e=>{e.O(0,[212,914,636,593,792],()=>e(e.s=9377)),_N_E=e.O()}]);"},{"name":"new-98cb870bd8339a29.js","path":"apps/web/out/_next/static/chunks/pages/admin/clients/new-98cb870bd8339a29.js","area":"FRONTEND","folder":"CLIENTS","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[119],{858:(e,a,t)=>{\\"use strict\\";t.d(a,{g:()=>d});var s=t(7876),l=t(4232),r=t(9099),n=t(5176),i=t(7932);let d=(e,a=[\\"admin\\"])=>{let t=Array.isArray(a)?a:[a];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",t),a=>{let d=(0,r.useRouter)(),[o,c]=(0,l.useState)(!0),[u,x]=(0,l.useState)(null);return((0,l.useEffect)(()=>{let e=(0,n.hg)(i.j2,async e=>{if(!e)return void d.replace(\\"/\\");x(e);try{let a=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${a}`),t.includes(a)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${a}\' no autorizado.`),d.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),d.replace(\\"/\\")}});return()=>e()},[d]),o)?(0,s.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,s.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,s.jsx)(e,{...a,currentUser:u})}}},2916:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/clients/new\\",function(){return t(4234)}])},4234:(e,a,t)=>{\\"use strict\\";t.r(a),t.d(a,{default:()=>b});var s=t(7876),l=t(4232),r=t(858),n=t(8753),i=t(9099),d=t(7932),o=t(7685),c=t(4799),u=t(8264),x=t(6514),m=t(5049),h=t(6346);function p(){let e=(0,i.useRouter)(),[a,t]=(0,l.useState)(1),[r,n]=(0,l.useState)(!1),[p,b]=(0,l.useState)({clientId:\\"\\",objectiveId:\\"\\",contractId:\\"\\"}),[g,f]=(0,l.useState)([]),[j,v]=(0,l.useState)({businessName:\\"\\",cuit:\\"\\",contactName:\\"\\",contactEmail:\\"\\"}),[y,N]=(0,l.useState)({name:\\"\\",address:\\"\\",latitude:\\"\\",longitude:\\"\\"}),[w,A]=(0,l.useState)({name:\\"\\",totalHoursPerMonth:720,startDate:new Date().toISOString().split(\\"T\\")[0],endDate:\\"\\",daysOfWeek:[1,2,3,4,5]}),[D,k]=(0,l.useState)({name:\\"Turno Ma\\\\xf1ana\\",code:\\"TM\\",startTime:\\"06:00\\",durationHours:8}),[C,S]=(0,l.useState)({totalVacancies:0,totalHours:0});(0,l.useEffect)(()=>{if(!w.startDate||0===g.length)return;let e=new Date(w.startDate),a=w.endDate?new Date(w.endDate):new Date(e.getFullYear(),e.getMonth()+1,0),t=0;for(let s=new Date(e);s<=a;s.setDate(s.getDate()+1))w.daysOfWeek.includes(s.getDay())&&t++;S({totalVacancies:t*g.length,totalHours:t*g.reduce((e,a)=>e+a.durationHours,0)})},[w,g]);let I=async e=>{e.preventDefault(),n(!0);try{let e=(await (0,d.Jo)({action:\\"CREATE_CLIENT\\",payload:{...j,status:\\"Active\\"}})).data;b(a=>({...a,clientId:e.data.id})),o.Ay.success(\\"Empresa registrada\\"),t(2)}catch(e){o.Ay.error(e.message)}finally{n(!1)}},M=async e=>{e.preventDefault(),n(!0);try{let e={...y,clientId:p.clientId,location:{latitude:Number(y.latitude),longitude:Number(y.longitude)},type:\\"Sede\\"},a=(await (0,d.Jo)({action:\\"CREATE_OBJECTIVE\\",payload:e})).data;b(e=>({...e,objectiveId:a.data.id})),o.Ay.success(\\"Sede creada\\"),t(3)}catch(e){o.Ay.error(e.message)}finally{n(!1)}},T=async e=>{e.preventDefault(),n(!0);try{let e={objectiveId:p.objectiveId,name:w.name,totalHoursPerMonth:w.totalHoursPerMonth,startDate:new Date(w.startDate).toISOString(),endDate:w.endDate?new Date(w.endDate).toISOString():void 0,daysOfWeek:w.daysOfWeek,quantity:1,isActive:!0},a=(await (0,d.Jo)({action:\\"CREATE_CONTRACT\\",payload:e})).data;b(e=>({...e,contractId:a.data.id})),o.Ay.success(\\"Contrato configurado\\"),t(4)}catch(e){o.Ay.error(e.message)}finally{n(!1)}},E=async e=>{e.preventDefault(),n(!0);try{let e={...D,contractId:p.contractId,color:\\"#3B82F6\\"},a=(await (0,d.Jo)({action:\\"CREATE_SHIFT_TYPE\\",payload:e})).data.data;await (0,d.createPattern)({contractId:p.contractId,shiftTypeId:a.id,daysOfWeek:w.daysOfWeek,quantity:1,validFrom:new Date(w.startDate).toISOString(),validTo:w.endDate?new Date(w.endDate).toISOString():void 0}),o.Ay.success(\\"Modalidad y Regla agregadas\\"),f(e=>[...e,D]);let t=\\"06:00\\";\\"06:00\\"===D.startTime&&(t=\\"14:00\\"),\\"14:00\\"===D.startTime&&(t=\\"22:00\\"),k({name:\\"\\",code:\\"\\",startTime:t,durationHours:8})}catch(e){o.Ay.error(e.message)}finally{n(!1)}},O=\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 py-2.5 px-3 border mt-1 text-sm\\",H=\\"block text-xs font-bold text-gray-500 uppercase tracking-wide mb-1\\",z=\\"w-full bg-indigo-600 text-white py-3 rounded-lg hover:bg-indigo-700 transition font-bold shadow-md flex justify-center items-center gap-2 disabled:opacity-50\\";return(0,s.jsxs)(\\"div\\",{className:\\"max-w-3xl mx-auto bg-white p-8 rounded-2xl shadow-xl border border-slate-100 my-8\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between mb-8 relative px-4\\",children:[(0,s.jsx)(\\"div\\",{className:\\"absolute top-1/2 left-0 w-full h-0.5 bg-slate-100 -z-10 rounded\\"}),[\\"Empresa\\",\\"Sede\\",\\"Contrato\\",\\"Turnos\\"].map((e,t)=>{let l=t+1;return(0,s.jsxs)(\\"div\\",{className:\\"flex flex-col items-center gap-2 bg-white px-2\\",children:[(0,s.jsx)(\\"div\\",{className:`w-8 h-8 rounded-full flex items-center justify-center border-2 transition-colors ${a>=l?\\"bg-indigo-600 border-indigo-600 text-white\\":\\"border-slate-200 text-slate-300\\"}`,children:a>l?(0,s.jsx)(c.A,{size:16}):l}),(0,s.jsx)(\\"span\\",{className:\\"text-[10px] uppercase font-bold text-slate-400\\",children:e})]},l)})]}),(0,s.jsxs)(\\"div\\",{className:\\"min-h-[300px]\\",children:[1===a&&(0,s.jsxs)(\\"form\\",{onSubmit:I,className:\\"space-y-4 animate-fadeIn\\",children:[(0,s.jsx)(\\"h2\\",{className:\\"text-xl font-bold text-slate-800\\",children:\\"Datos de la Empresa\\"}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Raz\\\\xf3n Social\\"}),(0,s.jsx)(\\"input\\",{className:O,value:j.businessName,onChange:e=>v({...j,businessName:e.target.value}),required:!0,autoFocus:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"CUIT\\"}),(0,s.jsx)(\\"input\\",{className:O,value:j.cuit,onChange:e=>v({...j,cuit:e.target.value}),required:!0})]}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",disabled:r,className:z,children:r?\\"...\\":\\"Siguiente\\"})]}),2===a&&(0,s.jsxs)(\\"form\\",{onSubmit:M,className:\\"space-y-4 animate-fadeIn\\",children:[(0,s.jsx)(\\"h2\\",{className:\\"text-xl font-bold text-slate-800\\",children:\\"Ubicaci\\\\xf3n del Servicio\\"}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Nombre Sede\\"}),(0,s.jsx)(\\"input\\",{className:O,value:y.name,onChange:e=>N({...y,name:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Direcci\\\\xf3n\\"}),(0,s.jsx)(\\"input\\",{className:O,value:y.address,onChange:e=>N({...y,address:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Latitud\\"}),(0,s.jsx)(\\"input\\",{type:\\"number\\",className:O,value:y.latitude,onChange:e=>N({...y,latitude:e.target.value}),step:\\"any\\",required:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Longitud\\"}),(0,s.jsx)(\\"input\\",{type:\\"number\\",className:O,value:y.longitude,onChange:e=>N({...y,longitude:e.target.value}),step:\\"any\\",required:!0})]})]}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",disabled:r,className:z,children:r?\\"...\\":\\"Siguiente\\"})]}),3===a&&(0,s.jsxs)(\\"form\\",{onSubmit:T,className:\\"space-y-5 animate-fadeIn\\",children:[(0,s.jsx)(\\"h2\\",{className:\\"text-xl font-bold text-slate-800\\",children:\\"Definici\\\\xf3n del Acuerdo\\"}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"col-span-2\\",children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Nombre Servicio\\"}),(0,s.jsx)(\\"input\\",{className:O,value:w.name,onChange:e=>A({...w,name:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Horas Mensuales (Vendidas)\\"}),(0,s.jsx)(\\"input\\",{type:\\"number\\",className:O,value:w.totalHoursPerMonth,onChange:e=>A({...w,totalHoursPerMonth:+e.target.value}),required:!0})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-4 rounded-xl border border-slate-200 space-y-4\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-2 text-indigo-700 text-sm font-bold border-b border-slate-200 pb-2 mb-2\\",children:[(0,s.jsx)(u.A,{size:16}),\\" Vigencia y Cobertura\\"]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Fecha Inicio\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:O,value:w.startDate,onChange:e=>A({...w,startDate:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"Fecha Fin (Opcional)\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:O,value:w.endDate,onChange:e=>A({...w,endDate:e.target.value})})]})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:H,children:\\"D\\\\xedas de Cobertura\\"}),(0,s.jsx)(\\"div\\",{className:\\"flex justify-between mt-2\\",children:[\\"D\\",\\"L\\",\\"M\\",\\"M\\",\\"J\\",\\"V\\",\\"S\\"].map((e,a)=>(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>{A(e=>{let t=e.daysOfWeek.includes(a)?e.daysOfWeek.filter(e=>e!==a):[...e.daysOfWeek,a].sort();return{...e,daysOfWeek:t}})},className:`w-9 h-9 rounded-lg text-xs font-bold transition-all ${w.daysOfWeek.includes(a)?\\"bg-indigo-600 text-white shadow-md scale-110\\":\\"bg-white border border-slate-200 text-slate-400\\"}`,children:e},a))})]})]}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",disabled:r,className:z,children:r?\\"Guardando...\\":\\"Confirmar Configuraci\\\\xf3n\\"})]}),4===a&&(0,s.jsxs)(\\"div\\",{className:\\"space-y-6 animate-fadeIn\\",children:[(0,s.jsx)(\\"div\\",{className:\\"bg-gradient-to-r from-slate-800 to-slate-900 rounded-xl p-5 text-white shadow-lg relative overflow-hidden\\",children:(0,s.jsxs)(\\"div\\",{className:\\"relative z-10 flex justify-between items-center\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsxs)(\\"p\\",{className:\\"text-xs text-slate-400 font-bold uppercase flex items-center gap-2\\",children:[(0,s.jsx)(x.A,{size:14}),\\" Proyecci\\\\xf3n Mensual\\"]}),(0,s.jsxs)(\\"div\\",{className:\\"mt-1 flex items-baseline gap-2\\",children:[(0,s.jsxs)(\\"span\\",{className:`text-2xl font-bold ${C.totalHours>w.totalHoursPerMonth?\\"text-red-400\\":\\"text-emerald-400\\"}`,children:[C.totalHours,\\" hs\\"]}),(0,s.jsxs)(\\"span\\",{className:\\"text-slate-500\\",children:[\\"/ \\",w.totalHoursPerMonth,\\" hs\\"]})]}),(0,s.jsxs)(\\"p\\",{className:\\"text-xs text-slate-400 mt-1\\",children:[C.totalVacancies,\\" Vacantes totales (\\",g.length,\\" turnos x \\",C.totalVacancies/(g.length||1),\\" d\\\\xedas)\\"]})]}),C.totalHours>w.totalHoursPerMonth&&(0,s.jsx)(\\"div\\",{className:\\"bg-red-500/20 p-2 rounded-lg border border-red-500/50 text-red-300\\",children:(0,s.jsx)(m.A,{size:20})})]})}),(0,s.jsxs)(\\"div\\",{className:\\"bg-white p-5 rounded-xl border border-slate-200 shadow-sm\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-sm font-bold text-slate-700 mb-3 uppercase\\",children:\\"Agregar Modalidad\\"}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4 mb-4\\",children:[(0,s.jsx)(\\"input\\",{className:O,value:D.name,onChange:e=>k({...D,name:e.target.value}),placeholder:\\"Nombre (ej: Ma\\\\xf1ana)\\"}),(0,s.jsx)(\\"input\\",{className:O,value:D.code,onChange:e=>k({...D,code:e.target.value}),placeholder:\\"C\\\\xf3digo (ej: TM)\\"}),(0,s.jsx)(\\"input\\",{type:\\"time\\",className:O,value:D.startTime,onChange:e=>k({...D,startTime:e.target.value})}),(0,s.jsx)(\\"input\\",{type:\\"number\\",className:O,value:D.durationHours,onChange:e=>k({...D,durationHours:+e.target.value}),placeholder:\\"Horas\\"})]}),(0,s.jsxs)(\\"button\\",{onClick:E,disabled:r||!D.name,className:\\"w-full bg-slate-100 text-slate-700 py-2.5 rounded-lg hover:bg-slate-200 font-bold transition flex justify-center items-center gap-2 border border-slate-200\\",children:[(0,s.jsx)(h.A,{size:16}),\\" Agregar Turno\\"]})]}),g.length>0&&(0,s.jsx)(\\"div\\",{className:\\"space-y-2\\",children:g.map((e,a)=>(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between items-center p-3 bg-slate-50 rounded-lg border border-slate-100 text-sm\\",children:[(0,s.jsx)(\\"span\\",{className:\\"font-bold text-slate-700\\",children:e.name}),(0,s.jsxs)(\\"span\\",{className:\\"font-mono text-xs bg-white px-2 py-1 rounded border\\",children:[e.startTime,\\" (\\",e.durationHours,\\"h)\\"]})]},a))}),(0,s.jsx)(\\"button\\",{onClick:()=>{o.Ay.success(\\"\\\\xa1Configuraci\\\\xf3n lista!\\"),e.push(\\"/admin/dashboard\\")},className:\\"w-full bg-green-600 text-white py-3 rounded-lg hover:bg-green-700 font-bold shadow-md\\",children:\\"Finalizar y Ver Planificador\\"})]})]})]})}let b=(0,r.g)(function(){return(0,s.jsx)(n.A,{title:\\"Alta de Cliente y Servicio\\",children:(0,s.jsx)(\\"div\\",{className:\\"py-6\\",children:(0,s.jsx)(p,{})})})},[\\"admin\\"])},4799:(e,a,t)=>{\\"use strict\\";t.d(a,{A:()=>s});let s=(0,t(7161).A)(\\"circle-check\\",[[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}],[\\"path\\",{d:\\"m9 12 2 2 4-4\\",key:\\"dzmm74\\"}]])},5049:(e,a,t)=>{\\"use strict\\";t.d(a,{A:()=>s});let s=(0,t(7161).A)(\\"triangle-alert\\",[[\\"path\\",{d:\\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\\",key:\\"wmoenq\\"}],[\\"path\\",{d:\\"M12 9v4\\",key:\\"juzpu7\\"}],[\\"path\\",{d:\\"M12 17h.01\\",key:\\"p32p05\\"}]])},6346:(e,a,t)=>{\\"use strict\\";t.d(a,{A:()=>s});let s=(0,t(7161).A)(\\"plus\\",[[\\"path\\",{d:\\"M5 12h14\\",key:\\"1ays0h\\"}],[\\"path\\",{d:\\"M12 5v14\\",key:\\"s699le\\"}]])},6514:(e,a,t)=>{\\"use strict\\";t.d(a,{A:()=>s});let s=(0,t(7161).A)(\\"calculator\\",[[\\"rect\\",{width:\\"16\\",height:\\"20\\",x:\\"4\\",y:\\"2\\",rx:\\"2\\",key:\\"1nb95v\\"}],[\\"line\\",{x1:\\"8\\",x2:\\"16\\",y1:\\"6\\",y2:\\"6\\",key:\\"x4nwl0\\"}],[\\"line\\",{x1:\\"16\\",x2:\\"16\\",y1:\\"14\\",y2:\\"18\\",key:\\"wjye3r\\"}],[\\"path\\",{d:\\"M16 10h.01\\",key:\\"1m94wz\\"}],[\\"path\\",{d:\\"M12 10h.01\\",key:\\"1nrarc\\"}],[\\"path\\",{d:\\"M8 10h.01\\",key:\\"19clt8\\"}],[\\"path\\",{d:\\"M12 14h.01\\",key:\\"1etili\\"}],[\\"path\\",{d:\\"M8 14h.01\\",key:\\"6423bh\\"}],[\\"path\\",{d:\\"M12 18h.01\\",key:\\"mhygvu\\"}],[\\"path\\",{d:\\"M8 18h.01\\",key:\\"lrp35t\\"}]])},8753:(e,a,t)=>{\\"use strict\\";t.d(a,{A:()=>N});var s=t(7876);t(4232);var l=t(8230),r=t.n(l),n=t(9099),i=t(9423),d=t(8264),o=t(5201),c=t(9065),u=t(1538),x=t(4763),m=t(4560),h=t(8423),p=t(6068),b=t(5164),g=t(4302),f=t(3657),j=t(7932),v=t(6647);function y(){let e=(0,n.useRouter)(),{clients:a,selectedClientId:t,setClient:l}=(0,v.t)(),y=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:i.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:d.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:u.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:x.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,s.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,s.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,s.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,s.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,s.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,s.jsxs)(\\"select\\",{value:t,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,s.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),a.map(e=>(0,s.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,s.jsx)(b.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,s.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,s.jsx)(r(),{href:\\"/admin/home\\",children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,s.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),y.map(a=>(0,s.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,s.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:a.title}),a.items.map(a=>(0,s.jsx)(r(),{href:a.href,children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===a.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,s.jsx)(a.icon,{size:16}),\\" \\",a.label]})},a.href))]},a.title))]}),(0,s.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,s.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,s.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:a}){return(0,s.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,s.jsx)(y,{}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,s.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,s.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:a})}),(0,s.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,s.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=2916)),_N_E=e.O()}]);"},{"name":"clients-7342ef5d0ed6345c.js","path":"apps/web/out/_next/static/chunks/pages/admin/clients-7342ef5d0ed6345c.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[828],{858:(e,t,s)=>{\\"use strict\\";s.d(t,{g:()=>c});var a=s(7876),l=s(4232),i=s(9099),r=s(5176),n=s(7932);let c=(e,t=[\\"admin\\"])=>{let s=Array.isArray(t)?t:[t];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",s),t=>{let c=(0,i.useRouter)(),[o,d]=(0,l.useState)(!0),[x,m]=(0,l.useState)(null);return((0,l.useEffect)(()=>{let e=(0,r.hg)(n.j2,async e=>{if(!e)return void c.replace(\\"/\\");m(e);try{let t=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${t}`),s.includes(t)?d(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${t}\' no autorizado.`),c.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),c.replace(\\"/\\")}});return()=>e()},[c]),o)?(0,a.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,a.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,a.jsx)(e,{...t,currentUser:x})}}},2349:(e,t,s)=>{\\"use strict\\";s.r(t),s.d(t,{default:()=>h});var a=s(7876),l=s(4232),i=s(858),r=s(8753),n=s(7685),c=s(7932),o=s(4104),d=s(6372),x=s(9120),m=s(6647);function u(){let{setClient:e}=(0,m.t)(),[t,s]=(0,l.useState)([]),[i,r]=(0,l.useState)(!0),[u,h]=(0,l.useState)(!1),[p,b]=(0,l.useState)(!1),[g,f]=(0,l.useState)(!1),[N,j]=(0,l.useState)({id:\\"\\",businessName:\\"\\",cuit:\\"\\",contactName:\\"\\",contactEmail:\\"\\",status:\\"Active\\"}),v=async()=>{r(!0);try{let e=(await (0,c.Jo)({action:\\"GET_ALL_CLIENTS\\",payload:{}})).data.data||[];s(e)}catch(e){console.error(e),n.Ay.error(\\"Error al cargar la cartera de clientes.\\")}finally{r(!1)}};(0,l.useEffect)(()=>{v()},[]);let y=async e=>{e.preventDefault(),f(!0);let t=n.Ay.loading(p?\\"Actualizando...\\":\\"Creando empresa...\\");try{p?(await (0,c.Jo)({action:\\"UPDATE_CLIENT\\",payload:{id:N.id,data:{businessName:N.businessName,cuit:N.cuit,contactName:N.contactName,contactEmail:N.contactEmail,status:N.status}}}),n.Ay.success(\\"Empresa actualizada\\",{id:t})):(await (0,c.Jo)({action:\\"CREATE_CLIENT\\",payload:{businessName:N.businessName,cuit:N.cuit,contactName:N.contactName,contactEmail:N.contactEmail,status:N.status}}),n.Ay.success(\\"Empresa creada exitosamente\\",{id:t})),h(!1),v()}catch(e){console.error(e),n.Ay.error(`Error: ${e.message}`,{id:t})}finally{f(!1)}},w=async(e,t)=>{if(!confirm(`\\\\xbfEst\\\\xe1s seguro de eliminar a ${t}? Esto podr\\\\xeda romper datos hist\\\\xf3ricos.`))return;let s=n.Ay.loading(\\"Eliminando...\\");try{await (0,c.Jo)({action:\\"DELETE_CLIENT\\",payload:{id:e}}),n.Ay.success(\\"Empresa eliminada\\",{id:s}),v()}catch(e){n.Ay.error(`Error: ${e.message}`,{id:s})}};return(0,a.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4\\",children:[(0,a.jsxs)(\\"div\\",{children:[(0,a.jsx)(\\"h2\\",{className:\\"text-2xl font-bold text-slate-800\\",children:\\"Cartera de Clientes\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-sm text-slate-500\\",children:\\"Gestione las empresas contratantes.\\"})]}),(0,a.jsxs)(x.A,{onClick:()=>{j({id:\\"\\",businessName:\\"\\",cuit:\\"\\",contactName:\\"\\",contactEmail:\\"\\",status:\\"Active\\"}),b(!1),h(!0)},primary:!0,className:\\"flex items-center shadow-sm\\",children:[(0,a.jsx)(\\"svg\\",{className:\\"w-5 h-5 mr-2\\",fill:\\"none\\",viewBox:\\"0 0 24 24\\",stroke:\\"currentColor\\",children:(0,a.jsx)(\\"path\\",{strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",strokeWidth:2,d:\\"M12 4v16m8-8H4\\"})}),\\"Nueva Empresa\\"]})]}),(0,a.jsx)(\\"div\\",{className:\\"bg-white shadow-sm rounded-xl border border-slate-200 overflow-hidden\\",children:i?(0,a.jsx)(\\"div\\",{className:\\"p-12 text-center text-slate-500 animate-pulse\\",children:\\"Cargando cartera...\\"}):(0,a.jsx)(\\"div\\",{className:\\"overflow-x-auto\\",children:(0,a.jsxs)(\\"table\\",{className:\\"min-w-full divide-y divide-slate-200\\",children:[(0,a.jsx)(\\"thead\\",{className:\\"bg-slate-50\\",children:(0,a.jsxs)(\\"tr\\",{children:[(0,a.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-slate-500 uppercase tracking-wider\\",children:\\"Raz\\\\xf3n Social\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-slate-500 uppercase tracking-wider\\",children:\\"CUIT / ID\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-slate-500 uppercase tracking-wider\\",children:\\"Contacto\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-slate-500 uppercase tracking-wider\\",children:\\"Estado\\"}),(0,a.jsx)(\\"th\\",{className:\\"px-6 py-3 text-right text-xs font-bold text-slate-500 uppercase tracking-wider\\",children:\\"Acciones\\"})]})}),(0,a.jsxs)(\\"tbody\\",{className:\\"bg-white divide-y divide-slate-200\\",children:[0===t.length&&(0,a.jsx)(\\"tr\\",{children:(0,a.jsx)(\\"td\\",{colSpan:5,className:\\"px-6 py-8 text-center text-slate-500 italic\\",children:\\"No hay clientes registrados.\\"})}),t.map(e=>(0,a.jsxs)(\\"tr\\",{className:\\"hover:bg-slate-50 transition duration-150\\",children:[(0,a.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,a.jsxs)(\\"div\\",{className:\\"flex items-center\\",children:[(0,a.jsx)(\\"div\\",{className:\\"h-10 w-10 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-700 font-bold text-sm mr-3\\",children:String(e.businessName).charAt(0)}),(0,a.jsx)(\\"div\\",{className:\\"text-sm font-bold text-slate-900\\",children:e.businessName})]})}),(0,a.jsxs)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap text-sm text-slate-600 font-mono\\",children:[e.cuit,(0,a.jsx)(\\"br\\",{}),(0,a.jsxs)(\\"span\\",{className:\\"text-[10px] text-slate-400\\",children:[e.id.substring(0,8),\\"...\\"]})]}),(0,a.jsxs)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:[(0,a.jsx)(\\"div\\",{className:\\"text-sm text-slate-900\\",children:e.contactName}),(0,a.jsx)(\\"div\\",{className:\\"text-xs text-slate-500\\",children:e.contactEmail})]}),(0,a.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,a.jsx)(\\"span\\",{className:`px-2.5 py-0.5 inline-flex text-xs leading-5 font-semibold rounded-full ${\\"Active\\"===e.status?\\"bg-green-100 text-green-800\\":\\"bg-red-100 text-red-800\\"}`,children:\\"Active\\"===e.status?\\"Activo\\":\\"Inactivo\\"})}),(0,a.jsxs)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap text-right text-sm font-medium\\",children:[(0,a.jsx)(\\"button\\",{onClick:()=>{j({id:e.id,businessName:String(e.businessName),cuit:String(e.cuit),contactName:e.contactName||\\"\\",contactEmail:String(e.contactEmail||\\"\\"),status:e.status}),b(!0),h(!0)},className:\\"text-indigo-600 hover:text-indigo-900 mr-4 font-semibold\\",children:\\"Editar\\"}),(0,a.jsx)(\\"button\\",{onClick:()=>w(e.id,String(e.businessName)),className:\\"text-rose-600 hover:text-rose-900 font-semibold\\",children:\\"Eliminar\\"})]})]},e.id))]})]})})}),u&&(0,a.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 overflow-y-auto bg-slate-900/50 backdrop-blur-sm flex items-center justify-center p-4\\",children:(0,a.jsxs)(\\"div\\",{className:\\"bg-white rounded-2xl shadow-xl max-w-lg w-full p-6 border border-slate-100 transform transition-all\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"flex justify-between items-center mb-6\\",children:[(0,a.jsx)(\\"h3\\",{className:\\"text-xl font-bold text-slate-800\\",children:p?\\"Editar Empresa\\":\\"Nueva Empresa\\"}),(0,a.jsx)(\\"button\\",{onClick:()=>h(!1),className:\\"text-slate-400 hover:text-slate-600\\",children:(0,a.jsx)(\\"svg\\",{className:\\"w-6 h-6\\",fill:\\"none\\",viewBox:\\"0 0 24 24\\",stroke:\\"currentColor\\",children:(0,a.jsx)(\\"path\\",{strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",strokeWidth:2,d:\\"M6 18L18 6M6 6l12 12\\"})})})]}),(0,a.jsxs)(\\"form\\",{onSubmit:y,className:\\"space-y-4\\",children:[(0,a.jsx)(o.A,{label:\\"Raz\\\\xf3n Social\\",id:\\"businessName\\",value:N.businessName,onChange:e=>j({...N,businessName:e.target.value}),placeholder:\\"Ej: Seguridad Integral S.A.\\",required:!0}),(0,a.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,a.jsx)(o.A,{label:\\"CUIT\\",id:\\"cuit\\",value:N.cuit,onChange:e=>j({...N,cuit:e.target.value}),placeholder:\\"30-12345678-9\\",required:!0}),(0,a.jsxs)(d.A,{label:\\"Estado\\",id:\\"status\\",value:N.status,onChange:e=>j({...N,status:e.target.value}),children:[(0,a.jsx)(\\"option\\",{value:\\"Active\\",children:\\"Activo\\"}),(0,a.jsx)(\\"option\\",{value:\\"Inactive\\",children:\\"Inactivo\\"})]})]}),(0,a.jsxs)(\\"div\\",{className:\\"pt-4 border-t border-slate-100\\",children:[(0,a.jsx)(\\"h4\\",{className:\\"text-sm font-semibold text-slate-500 uppercase mb-3\\",children:\\"Datos de Contacto\\"}),(0,a.jsxs)(\\"div\\",{className:\\"space-y-4\\",children:[(0,a.jsx)(o.A,{label:\\"Nombre Contacto\\",id:\\"contactName\\",value:N.contactName,onChange:e=>j({...N,contactName:e.target.value}),placeholder:\\"Ej: Juan Gerente\\"}),(0,a.jsx)(o.A,{label:\\"Email Contacto\\",id:\\"contactEmail\\",type:\\"email\\",value:N.contactEmail,onChange:e=>j({...N,contactEmail:e.target.value}),placeholder:\\"contacto@empresa.com\\"})]})]}),(0,a.jsxs)(\\"div\\",{className:\\"flex justify-end space-x-3 mt-8 pt-2\\",children:[(0,a.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>h(!1),className:\\"px-4 py-2 text-slate-700 bg-slate-100 rounded-lg hover:bg-slate-200 font-medium transition-colors\\",children:\\"Cancelar\\"}),(0,a.jsx)(x.A,{type:\\"submit\\",primary:!0,disabled:g,children:g?\\"Guardando...\\":\\"Guardar Empresa\\"})]})]})]})})]})}let h=(0,i.g)(function(){return(0,a.jsx)(r.A,{title:\\"Gesti\\\\xf3n de Clientes y Empresas\\",children:(0,a.jsx)(u,{})})},[\\"admin\\",\\"manager\\"])},4104:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});var a=s(7876);function l({label:e,id:t,type:s=\\"text\\",rows:l=1,className:i,...r}){let n=\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 p-2 text-sm\\";return(0,a.jsxs)(\\"div\\",{className:`space-y-1 ${i}`,children:[(0,a.jsx)(\\"label\\",{htmlFor:t,className:\\"block text-sm font-medium text-gray-700\\",children:e}),\\"textarea\\"===s?(0,a.jsx)(\\"textarea\\",{id:t,className:n,rows:l,...r}):(0,a.jsx)(\\"input\\",{id:t,type:s,className:n,...r})]})}s(4232)},6372:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});var a=s(7876);function l({label:e,id:t,children:s,className:l,...i}){return(0,a.jsxs)(\\"div\\",{className:`space-y-1 ${l}`,children:[(0,a.jsx)(\\"label\\",{htmlFor:t,className:\\"block text-sm font-medium text-gray-700\\",children:e}),(0,a.jsx)(\\"select\\",{id:t,className:\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 py-2 text-sm\\",...i,children:s})]})}s(4232)},8753:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>y});var a=s(7876);s(4232);var l=s(8230),i=s.n(l),r=s(9099),n=s(9423),c=s(8264),o=s(5201),d=s(9065),x=s(1538),m=s(4763),u=s(4560),h=s(8423),p=s(6068),b=s(5164),g=s(4302),f=s(3657),N=s(7932),j=s(6647);function v(){let e=(0,r.useRouter)(),{clients:t,selectedClientId:s,setClient:l}=(0,j.t)(),v=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:c.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:d.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:u.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,a.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,a.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,a.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,a.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,a.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,a.jsxs)(\\"select\\",{value:s,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,a.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),t.map(e=>(0,a.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,a.jsx)(b.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,a.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,a.jsx)(i(),{href:\\"/admin/home\\",children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,a.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),v.map(t=>(0,a.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,a.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:t.title}),t.items.map(t=>(0,a.jsx)(i(),{href:t.href,children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===t.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,a.jsx)(t.icon,{size:16}),\\" \\",t.label]})},t.href))]},t.title))]}),(0,a.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,a.jsxs)(\\"button\\",{onClick:()=>N.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,a.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function y({children:e,title:t}){return(0,a.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,a.jsx)(v,{}),(0,a.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,a.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,a.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:t})}),(0,a.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,a.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9120:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});var a=s(7876);function l({primary:e=!0,children:t,className:s,disabled:l,...i}){return(0,a.jsx)(\\"button\\",{className:`px-4 py-2 rounded-lg font-semibold transition-colors duration-150 ${e?\\"bg-indigo-600 text-white hover:bg-indigo-700 disabled:bg-indigo-300\\":\\"bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:bg-gray-100\\"} ${s||\\"\\"}`,disabled:l,...i,children:t})}s(4232)},9321:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/clients\\",function(){return s(2349)}])}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=9321)),_N_E=e.O()}]);"},{"name":"dashboard-d89e3d0de3e9d259.js","path":"apps/web/out/_next/static/chunks/pages/admin/dashboard-d89e3d0de3e9d259.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36],{811:(e,t,a)=>{\\"use strict\\";a.r(t),a.d(t,{default:()=>ei});var s=a(7876),r=a(4232),i=a(7328),l=a.n(i),n=a(9099),o=a(2283),d=a(2423),c=a(1538),x=a(2391),m=a(9370),g=a(4734),u=a(4015),p=a(2663),h=a(6346),b=a(9982),f=a(4560),y=a(7104),v=a(5266),j=a(6863),N=a(5002),A=a(129),w=a(3144),D=a(485),T=a(858),E=a(8753),C=a(6647),S=a(7932),I=a(4144),k=a(2680),z=a(505),M=a(5008),L=a(4908),V=a(8337),O=a(6790),R=a(973),G=a(9032),_=a(4460),H=a(6747),P=a(457),$=a(289),U=a(3626),B=a(6259),F=a(4182),Y=a(397),X=a(5079),J=a(5449),W=a(6945),q=a(6850),Q=a(8640),Z=a(4927),K=a(212),ee=a(6264);function et(...e){return(0,ee.QP)((0,K.$)(e))}let ea=(e,t)=>{switch(t.type){case\\"SET_VIEW\\":return{...e,view:t.payload};case\\"NAVIGATE_NEXT\\":{let{view:t,currentDate:a}=e,s=\\"month\\"===t?(0,I.P)(a,1):(0,k.f)(a,\\"week\\"===t?7:1);return{...e,currentDate:s}}case\\"NAVIGATE_PREV\\":{let{view:t,currentDate:a}=e,s=\\"month\\"===t?(0,z.a)(a,1):(0,k.f)(a,\\"week\\"===t?-7:-1);return{...e,currentDate:s}}case\\"NAVIGATE_TODAY\\":return{...e,currentDate:new Date};case\\"SET_DATE\\":return{...e,currentDate:t.payload};default:return e}},es=r.memo(({events:e=[],isLoading:t=!1,onEventClick:a,onDropInfo:i,onEventMove:l,onDateChange:n,onViewChange:o,startHour:c=0,endHour:x=24,readOnly:m=!1})=>{let g,u,[p,h]=(0,r.useReducer)(ea,{currentDate:new Date,view:\\"week\\"}),[b,f]=(0,r.useState)(60);(0,r.useEffect)(()=>{n&&n(p.currentDate)},[p.currentDate,n]),(0,r.useEffect)(()=>{o&&o(p.view)},[p.view,o]);let v=(0,r.useMemo)(()=>e.map(e=>({...e,start:\\"string\\"==typeof e.start?(0,M.H)(e.start):e.start,end:\\"string\\"==typeof e.end?(0,M.H)(e.end):e.end})),[e]),j=(e,t)=>{if(e.preventDefault(),e.stopPropagation(),m)return;let a=e.dataTransfer.getData(\\"employeeId\\"),s=e.dataTransfer.getData(\\"employeeName\\");a&&i&&i({employeeId:a,employeeName:s,targetShiftId:t.id})};return(0,s.jsxs)(\\"div\\",{className:\\"flex flex-col h-full bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden\\",children:[(0,s.jsxs)(\\"header\\",{className:\\"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-white\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-4\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex items-center bg-gray-100 rounded-lg p-1\\",children:[(0,s.jsx)(\\"button\\",{onClick:()=>h({type:\\"NAVIGATE_PREV\\"}),className:\\"p-1 hover:bg-white rounded\\",children:(0,s.jsx)(W.A,{size:18})}),(0,s.jsx)(\\"button\\",{onClick:()=>h({type:\\"NAVIGATE_TODAY\\"}),className:\\"px-3 text-xs font-bold hover:bg-white rounded\\",children:\\"Hoy\\"}),(0,s.jsx)(\\"button\\",{onClick:()=>h({type:\\"NAVIGATE_NEXT\\"}),className:\\"p-1 hover:bg-white rounded\\",children:(0,s.jsx)(q.A,{size:18})})]}),(0,s.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-gray-800 capitalize min-w-[150px] text-center\\",children:(0,d.GP)(p.currentDate,\\"MMMM yyyy\\",{locale:X.es})})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex gap-2 items-center\\",children:[(\\"week\\"===p.view||\\"day\\"===p.view)&&(0,s.jsxs)(\\"div\\",{className:\\"flex items-center bg-gray-50 rounded-lg p-1 border border-gray-200 mr-2\\",children:[(0,s.jsx)(\\"button\\",{onClick:()=>f(e=>Math.max(30,e-10)),className:\\"p-1 hover:bg-white rounded text-gray-500\\",title:\\"Alejar\\",children:(0,s.jsx)(Q.A,{size:14})}),(0,s.jsxs)(\\"span\\",{className:\\"text-[10px] font-mono w-8 text-center text-gray-400\\",children:[Math.round(b/60*100),\\"%\\"]}),(0,s.jsx)(\\"button\\",{onClick:()=>f(e=>Math.min(150,e+10)),className:\\"p-1 hover:bg-white rounded text-gray-500\\",title:\\"Acercar\\",children:(0,s.jsx)(Z.A,{size:14})})]}),m&&(0,s.jsxs)(\\"span\\",{className:\\"text-xs bg-gray-100 text-gray-500 px-2 py-1 rounded-md font-bold flex items-center gap-1\\",children:[(0,s.jsx)(J.A,{size:12}),\\" Lectura\\"]}),t&&(0,s.jsx)(\\"span\\",{className:\\"text-xs text-blue-500 animate-pulse self-center\\",children:\\"Cargando...\\"}),(0,s.jsx)(\\"div\\",{className:\\"flex bg-gray-100 rounded-lg p-1\\",children:[\\"month\\",\\"week\\",\\"day\\"].map(e=>(0,s.jsx)(\\"button\\",{onClick:()=>h({type:\\"SET_VIEW\\",payload:e}),className:et(\\"px-3 py-1 text-xs font-medium rounded capitalize\\",p.view===e?\\"bg-white shadow text-indigo-600\\":\\"text-gray-500\\"),children:\\"month\\"===e?\\"Mes\\":\\"week\\"===e?\\"Sem\\":\\"D\\\\xeda\\"},e))})]})]}),(0,s.jsx)(\\"div\\",{className:\\"flex-1 overflow-hidden relative\\",children:\\"month\\"===p.view?(()=>{let e=(0,V.w)(p.currentDate),t=(0,O.p)(e),r=(0,R.k)(e,{weekStartsOn:1}),l=(0,G.$)(t,{weekStartsOn:1}),n=[],o=r,c=[];for(;o<=l;){for(let t=0;t<7;t++){let t=o,r=(0,_.r)(o,new Date),l=v.filter(e=>(0,_.r)(e.start,t)).sort((e,t)=>e.start.getTime()-t.start.getTime());n.push((0,s.jsxs)(\\"div\\",{className:et(\\"min-h-[120px] border-b border-r border-gray-100 p-1 relative transition-colors\\",(0,_.r)(o,e)||o.getMonth()===e.getMonth()?\\"\\":\\"bg-gray-50/30 text-gray-400\\",!m&&\\"hover:bg-gray-50\\"),onClick:()=>h({type:\\"SET_DATE\\",payload:t}),onDragOver:m?void 0:e=>e.preventDefault(),onDrop:m?void 0:e=>{let a=e.dataTransfer.getData(\\"employeeId\\"),s=e.dataTransfer.getData(\\"employeeName\\");a&&i&&i({employeeId:a,employeeName:s,start:(0,H.a)(t,9),end:(0,H.a)(t,17)})},children:[(0,s.jsx)(\\"div\\",{className:\\"flex justify-between items-center mb-1\\",children:(0,s.jsx)(\\"span\\",{className:et(\\"text-xs font-bold w-6 h-6 flex items-center justify-center rounded-full\\",r?\\"bg-indigo-600 text-white\\":\\"\\"),children:(0,d.GP)(o,\\"d\\")})}),(0,s.jsxs)(\\"div\\",{className:\\"flex flex-col gap-1 overflow-y-auto max-h-[90px] scrollbar-hide\\",children:[\\" \\",l.map(e=>(0,s.jsxs)(\\"div\\",{onClick:t=>{t.stopPropagation(),a?.(e)},className:et(\\"text-[10px] px-1 rounded truncate cursor-pointer flex items-center gap-1 shadow-sm\\",e.color||\\"bg-blue-100 text-blue-800\\"),title:e.title,draggable:!m,onDragStart:m?void 0:t=>{t.dataTransfer.setData(\\"shiftId\\",e.id),t.dataTransfer.effectAllowed=\\"move\\"},onDragOver:m?void 0:e=>e.preventDefault(),onDrop:m?void 0:t=>j(t,e),children:[m&&(0,s.jsx)(J.A,{size:8,className:\\"opacity-50\\"}),(0,s.jsx)(\\"span\\",{className:\\"font-bold\\",children:(0,d.GP)(e.start,\\"HH:mm\\")}),\\" \\",e.title]},e.id))]})]},o.toISOString())),o=(0,k.f)(o,1)}c.push((0,s.jsx)(\\"div\\",{className:\\"grid grid-cols-7\\",children:n},o.toISOString())),n=[]}return(0,s.jsx)(\\"div\\",{className:\\"border-l border-t border-gray-200\\",children:c})})():(g=\\"week\\"===p.view?Array.from({length:7}).map((e,t)=>(0,k.f)((0,R.k)(p.currentDate,{weekStartsOn:1}),t)):[p.currentDate],u=Array.from({length:x-c}).map((e,t)=>c+t),(0,s.jsxs)(\\"div\\",{className:\\"flex flex-col h-full bg-white relative overflow-hidden\\",children:[(0,s.jsx)(\\"div\\",{className:\\"flex border-b border-gray-200 ml-14\\",children:g.map(e=>{let t=(0,_.r)(e,new Date);return(0,s.jsxs)(\\"div\\",{className:\\"flex-1 py-2 text-center border-r border-gray-100\\",children:[(0,s.jsx)(\\"div\\",{className:et(\\"text-xs uppercase font-bold\\",t?\\"text-indigo-600\\":\\"text-gray-500\\"),children:(0,d.GP)(e,\\"EEE\\",{locale:X.es})}),(0,s.jsx)(\\"div\\",{className:et(\\"text-lg font-bold\\",t?\\"text-indigo-600\\":\\"text-gray-800\\"),children:(0,d.GP)(e,\\"d\\")})]},e.toISOString())})}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 overflow-y-auto relative flex\\",children:[(0,s.jsx)(\\"div\\",{className:\\"w-14 flex-shrink-0 bg-gray-50 border-r border-gray-200 sticky left-0 z-10 select-none bg-white\\",children:u.map(e=>{let t=(0,P.g)((0,H.a)(new Date,e),0);return(0,s.jsx)(\\"div\\",{className:\\"border-b border-gray-100 text-[10px] text-gray-400 text-right pr-2 pt-1 relative box-border\\",style:{height:b},children:(0,s.jsx)(\\"span\\",{className:\\"-top-2 relative\\",children:(0,d.GP)(t,\\"HH:mm\\")})},e)})}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 flex relative min-w-[600px]\\",children:[(0,s.jsx)(\\"div\\",{className:\\"absolute inset-0 flex flex-col z-0\\",children:u.map(e=>(0,s.jsx)(\\"div\\",{className:\\"w-full border-b border-gray-100 box-border\\",style:{height:b}},e))}),g.map(e=>{let t=(0,$.o)(e),r=(0,U.D)(e),n=v.filter(e=>{let a=e.start,s=e.end;return(0,B.Y)(a,r)&&(0,F.d)(s,t)});return(0,s.jsxs)(\\"div\\",{className:\\"flex-1 border-r border-gray-100 relative h-full group/col\\",children:[!m&&(0,s.jsx)(\\"div\\",{className:\\"absolute inset-0 z-0 flex flex-col opacity-0 group-hover/col:opacity-100 transition-opacity\\",children:u.map(t=>(0,s.jsx)(\\"div\\",{style:{height:b},className:\\"w-full hover:bg-indigo-50/30 border-b border-transparent box-border\\",onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=\\"move\\"},onDrop:a=>((e,t,a)=>{if(e.preventDefault(),m)return;let s=e.currentTarget.getBoundingClientRect(),r=15*Math.round(Math.floor((e.clientY-s.top)/b*60)/15),n=new Date(t);n.setHours(a,r,0,0);let o=e.dataTransfer.getData(\\"shiftId\\");if(o&&l){let e=v.find(e=>e.id===o);if(e){let t=e.end.getTime()-e.start.getTime(),a=new Date(n.getTime()+t);l(e,n,a)}return}let d=e.dataTransfer.getData(\\"employeeId\\"),c=e.dataTransfer.getData(\\"employeeName\\");if(d&&i){let e=(0,L.z)(n,480);i({employeeId:d,employeeName:c,start:n,end:e})}})(a,e,t)},t))}),n.map(i=>{let l=i.start,n=i.end,o=(0,B.Y)(l,t)?t:l,x=(0,F.d)(n,r)?r:n,g=o.getHours(),u=o.getMinutes();if(x.getHours(){e.stopPropagation(),a?.(i)},draggable:!m,onDragStart:m?void 0:e=>{e.dataTransfer.setData(\\"shiftId\\",i.id),e.dataTransfer.effectAllowed=\\"move\\"},onDragOver:m?void 0:e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=\\"copy\\"},onDrop:m?void 0:e=>j(e,i),className:et(\\"absolute left-1 right-1 rounded border-l-4 p-1 shadow-sm cursor-pointer transition-all text-xs overflow-hidden group z-10\\",!m&&\\"hover:z-50 hover:brightness-95 hover:shadow-md\\",m&&\\"opacity-90\\",i.color||\\"bg-indigo-50 border-indigo-500\\"),style:{top:`${p}px`,height:`${h}px`},title:`${i.title}\\n${(0,d.GP)(l,\\"HH:mm\\")} - ${(0,d.GP)(n,\\"HH:mm\\")}`,children:[m&&(0,s.jsx)(J.A,{size:10,className:\\"absolute top-1 right-1 text-gray-500 opacity-50\\"}),(0,s.jsx)(\\"div\\",{className:\\"font-bold truncate group-hover:whitespace-normal\\",children:i.title}),(0,s.jsxs)(\\"div\\",{className:\\"opacity-80 truncate text-[10px] flex items-center gap-1\\",children:[(0,s.jsx)(y.A,{size:10}),(0,d.GP)(l,\\"HH:mm\\"),\\" - \\",(0,d.GP)(n,\\"HH:mm\\")]})]},`${i.id}-${e.toISOString()}`)})]},e.toISOString())})]})]})]}))})]})});var er=a(7685);let ei=(0,T.g)(()=>{(0,n.useRouter)();let e=(0,C.t)(),t=e?.client||e?.selectedClient||null,a=t?.id||\\"\\",[i,T]=(0,r.useState)([]),[I,k]=(0,r.useState)([]),[z,M]=(0,r.useState)([]),[L,V]=(0,r.useState)([]),[O,R]=(0,r.useState)(\\"\\"),[G,_]=(0,r.useState)(!1),[H,P]=(0,r.useState)({totalHours:0,vacancies:0,occupancyRate:0}),[$,U]=(0,r.useState)(\\"\\"),[B,F]=(0,r.useState)(\\"ALL\\"),[Y,X]=(0,r.useState)(null),[J,W]=(0,r.useState)(!1),[q,Q]=(0,r.useState)(!1),Z=()=>{let e=new Date,t=6e4*e.getTimezoneOffset();return new Date(e.getTime()-t).toISOString().split(\\"T\\")[0]},[K,ee]=(0,r.useState)({sourceDate:Z(),targetStart:Z(),targetEnd:Z(),targetDays:[1,2,3,4,5]}),et=(0,r.useCallback)(async()=>{_(!0);try{let e,t=a?{clientId:a}:{},s=(await (0,S.kU)({action:\\"GET_ALL_OBJECTIVES\\",payload:t})).data.data;M(s),O&&!s.find(e=>e.id===O)&&R(\\"\\");let r=(await (0,S.r6)({action:\\"GET_ALL_EMPLOYEES\\",payload:t})).data.data;k(r);let i=(0,D.rJ)(S.db,\\"ausencias\\"),l=new Date;l.setHours(0,0,0,0);let n=(0,D.P)(i,(0,D._M)(\\"endDate\\",\\">=\\",D.Dc.fromDate(l)),(0,D._M)(\\"status\\",\\"==\\",\\"APPROVED\\")),o=await (0,D.GG)(n),d=[];o.forEach(e=>d.push({id:e.id,...e.data()})),V(d);let c=(0,D.rJ)(S.db,\\"turnos\\");if(O){let t=new Date;t.setMonth(t.getMonth()-1),e=(0,D.P)(c,(0,D._M)(\\"objectiveId\\",\\"==\\",O),(0,D._M)(\\"startTime\\",\\">=\\",D.Dc.fromDate(t)))}else if(s.length>0){let t=s.map(e=>e.id).slice(0,10);e=(0,D.P)(c,(0,D._M)(\\"objectiveId\\",\\"in\\",t))}else{T([]),P({totalHours:0,vacancies:0,occupancyRate:0});return}let x=await (0,D.GG)(e),m=[];x.forEach(e=>{let t=e.data();m.push({id:e.id,...t})}),m.sort((e,t)=>{let a=e.startTime instanceof D.Dc?e.startTime.toMillis():new Date(e.startTime).getTime(),s=t.startTime instanceof D.Dc?t.startTime.toMillis():new Date(t.startTime).getTime();return a-s}),T(m),ea(m)}catch(e){console.error(\\"Error cargando:\\",e),er.Ay.error(e.message)}finally{_(!1)}},[a,O]),ea=e=>{let t=e.length,a=e.filter(e=>\\"VACANTE\\"!==e.employeeId).length,s=0;e.forEach(e=>{let t=e.startTime instanceof D.Dc?e.startTime.toDate():new Date(e.startTime),a=((e.endTime instanceof D.Dc?e.endTime.toDate():new Date(e.endTime)).getTime()-t.getTime())/36e5;s+=a}),P({totalHours:Math.round(s),vacancies:t-a,occupancyRate:t>0?Math.round(a/t*100):0})};(0,r.useEffect)(()=>{et()},[et]);let ei=(0,r.useMemo)(()=>{let e={};return i.forEach(t=>{if(t.employeeId&&\\"VACANTE\\"!==t.employeeId){let a=t.startTime instanceof D.Dc?t.startTime.toDate():new Date(t.startTime),s=t.endTime instanceof D.Dc?t.endTime.toDate():new Date(t.endTime),r=(0,o.M)(s,a);e[t.employeeId]=(e[t.employeeId]||0)+r}}),e},[i]),el=e=>{let t=L.find(t=>t.employeeId===e);if(t)return{status:\\"UNAVAILABLE\\",reason:t.type,hours:0};let a=ei[e]||0;return a>48?{status:\\"OVERLOADED\\",hours:a}:a>0?{status:\\"BUSY\\",hours:a}:{status:\\"AVAILABLE\\",hours:0}},en=(0,r.useMemo)(()=>I.filter(e=>{let t=e.name.toLowerCase().includes($.toLowerCase())||e.dni&&e.dni.includes($),a=\\"ALL\\"===B||e.role===B||\\"Vigilador\\"===B&&!e.role;return t&&a}).sort((e,t)=>{let a=el(e.uid),s=el(t.uid),r=e=>\\"AVAILABLE\\"===e?1:\\"BUSY\\"===e?2:\\"OVERLOADED\\"===e?3:4;return r(a.status)-r(s.status)}),[I,$,B,ei,L]),eo=async(e,t=!1)=>{if(\\"UNAVAILABLE\\"===el(e.employeeId).status)return void er.Ay.error(`⛔ ${e.employeeName} tiene licencia activa.`);let a=e.targetShiftId;if(!a&&e.start&&O){let t=e.start.getTime(),s=i.find(e=>{if(\\"VACANTE\\"!==e.employeeId||e.objectiveId!==O||\\"Canceled\\"===e.status)return!1;let a=e.startTime instanceof D.Dc?e.startTime.toMillis():new Date(e.startTime).getTime(),s=e.endTime instanceof D.Dc?e.endTime.toMillis():new Date(e.endTime).getTime();return t>=a&&t{if(!O)return er.Ay.error(\\"Seleccione un Objetivo.\\");let e=z.find(e=>e.id===O);if(!e)return;_(!0);let t=er.Ay.loading(\\"Buscando contrato...\\");try{let a=await (0,S.Zt)(e.id);if(!a)throw Error(\\"No hay contrato activo.\\");if(!confirm(`Generar vacantes seg\\\\xfan contrato \\"${a.name}\\"?`)){_(!1),er.Ay.dismiss(t);return}er.Ay.loading(\\"Generando vacantes...\\",{id:t});let s=new Date,r=await (0,S.zR)({action:\\"GENERATE_VACANCIES\\",payload:{contractId:a.id,objectiveId:e.id,month:s.getMonth()+1,year:s.getFullYear()}});er.Ay.success(r.data.message,{id:t}),et()}catch(e){er.Ay.error(e.message,{id:t})}finally{_(!1)}},ec=async()=>{if(!O)return er.Ay.error(\\"Seleccione un objetivo.\\");_(!0);let e=er.Ay.loading(\\"Replicando...\\");try{let t=(await (0,S.vw)({action:\\"REPLICATE_STRUCTURE\\",payload:{objectiveId:O,sourceDate:K.sourceDate,targetStartDate:K.targetStart,targetEndDate:K.targetEnd,targetDays:K.targetDays}})).data;er.Ay.success(t.message,{id:e}),Q(!1),et()}catch(t){er.Ay.error(t.message,{id:e})}finally{_(!1)}},ex=async()=>{if(!O)return er.Ay.error(\\"Seleccione objetivo.\\");if(confirm(\\"⚠️ Se eliminar\\\\xe1n todas las VACANTES vac\\\\xedas del mes actual. \\\\xbfSeguro?\\")){_(!0);try{let e=new Date;await (0,S.zR)({action:\\"CLEAR_VACANCIES\\",payload:{objectiveId:O,month:e.getMonth()+1,year:e.getFullYear()}}),er.Ay.success(\\"Limpiado\\"),et()}catch(e){er.Ay.error(e.message)}finally{_(!1)}}},em=async()=>{if(!Y)return;let e=\\"VACANTE\\"===Y.employeeId;if(confirm(e?\\"Borrar vacante?\\":\\"Desasignar empleado?\\"))try{e?(await (0,S.vw)({action:\\"DELETE_SHIFT\\",payload:{id:Y.id}}),er.Ay.success(\\"Eliminado\\")):(await (0,S.vw)({action:\\"UPDATE_SHIFT\\",payload:{id:Y.id,data:{employeeId:\\"VACANTE\\",employeeName:\\"VACANTE\\",status:\\"Assigned\\"}}}),er.Ay.success(\\"Desasignado\\")),W(!1),et()}catch(e){er.Ay.error(e.message)}},eg=async()=>{if(Y)try{let e=Y.startTime instanceof D.Dc?Y.startTime.toDate():new Date(Y.startTime),t=Y.endTime instanceof D.Dc?Y.endTime.toDate():new Date(Y.endTime);await (0,S.mm)({employeeId:Y.employeeId,employeeName:Y.employeeName,objectiveId:Y.objectiveId,objectiveName:Y.objectiveName,startTime:e,endTime:t,status:\\"Assigned\\",role:Y.role}),er.Ay.success(\\"Duplicado\\"),W(!1),et()}catch(e){er.Ay.error(e.message)}},eu=(0,r.useMemo)(()=>i.map(e=>{let t=e.startTime instanceof D.Dc?e.startTime.toDate():new Date(e.startTime),a=e.endTime instanceof D.Dc?e.endTime.toDate():new Date(e.endTime),s=\\"VACANTE\\"===e.employeeId,r=!O,i=s?\\"VACANTE\\":e.employeeName;return r&&(i=`${e.objectiveName} | ${i}`),{id:e.id,title:i,description:e.objectiveName,start:t,end:a,color:s?\\"bg-gray-100 border-gray-400 text-gray-500 border-dashed\\":e.isOvertime?\\"bg-amber-100 border-amber-500 text-amber-900 ring-1 ring-amber-300\\":\\"bg-indigo-100 border-indigo-600 text-indigo-900\\",originalData:e}}),[i,O]),ep=t?.businessName?`Planificaci\\\\xf3n - ${t.businessName}`:\\"Centro de Control Global\\",eh=!O;return(0,s.jsxs)(E.A,{title:ep,children:[(0,s.jsx)(l(),{children:(0,s.jsxs)(\\"title\\",{children:[ep,\\" | CronoApp\\"]})}),(0,s.jsxs)(\\"div\\",{className:\\"flex flex-col h-[calc(100vh-80px)] space-y-4 p-2\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-sm border border-gray-200 p-4 flex flex-wrap gap-4 items-center justify-between\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-4 flex-1\\",children:[(0,s.jsx)(\\"div\\",{className:\\"bg-indigo-50 p-2 rounded-lg\\",children:a?(0,s.jsx)(c.A,{className:\\"text-indigo-600\\",size:24}):(0,s.jsx)(x.A,{className:\\"text-blue-600\\",size:24})}),(0,s.jsxs)(\\"div\\",{className:\\"flex flex-col w-full max-w-md\\",children:[(0,s.jsx)(\\"label\\",{className:\\"text-[10px] font-bold text-gray-400 uppercase tracking-wider mb-1\\",children:a?\\"Seleccione Sede\\":\\"Seleccione Objetivo\\"}),(0,s.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,s.jsxs)(\\"select\\",{value:O,onChange:e=>R(e.target.value),className:\\"w-full appearance-none bg-white border border-gray-300 text-gray-700 py-2 px-3 pr-8 rounded-lg leading-tight focus:outline-none focus:border-indigo-500 font-bold\\",children:[(0,s.jsx)(\\"option\\",{value:\\"\\",children:\\"-- Monitor Global (Solo Lectura) --\\"}),z.map(e=>(0,s.jsxs)(\\"option\\",{value:e.id,children:[e.name,\\" \\",a?\\"\\":`(${e.address})`]},e.id))]}),(0,s.jsx)(\\"div\\",{className:\\"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700\\",children:(0,s.jsx)(m.A,{size:16})})]})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-4\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"px-3 py-1 bg-indigo-50 rounded border border-indigo-100 text-center\\",children:[(0,s.jsx)(\\"span\\",{className:\\"text-[9px] text-indigo-500 font-bold block uppercase\\",children:\\"Horas\\"}),(0,s.jsx)(\\"span\\",{className:\\"text-lg font-bold text-indigo-700\\",children:H.totalHours})]}),(0,s.jsxs)(\\"div\\",{className:\\"px-3 py-1 bg-red-50 rounded border border-red-100 text-center\\",children:[(0,s.jsx)(\\"span\\",{className:\\"text-[9px] text-red-500 font-bold block uppercase\\",children:\\"Vacantes\\"}),(0,s.jsx)(\\"span\\",{className:\\"text-lg font-bold text-red-600\\",children:H.vacancies})]}),(0,s.jsx)(\\"div\\",{className:\\"h-8 w-px bg-gray-200 mx-2\\"}),(0,s.jsxs)(\\"div\\",{className:\\"flex gap-2\\",children:[(0,s.jsx)(\\"button\\",{onClick:et,className:\\"p-2 border rounded hover:bg-gray-50 text-gray-600\\",title:\\"Refrescar\\",children:(0,s.jsx)(g.A,{size:18,className:G?\\"animate-spin\\":\\"\\"})}),(0,s.jsx)(\\"button\\",{onClick:ex,className:\\"p-2 border border-red-200 text-red-600 rounded hover:bg-red-50 disabled:opacity-50\\",title:\\"Limpiar\\",disabled:eh||G,children:(0,s.jsx)(u.A,{size:18})}),(0,s.jsx)(\\"button\\",{onClick:()=>Q(!0),className:\\"p-2 border border-indigo-200 text-indigo-600 rounded hover:bg-indigo-50 disabled:opacity-50\\",title:\\"Copiar D\\\\xeda\\",disabled:eh||G,children:(0,s.jsx)(p.A,{size:18})}),(0,s.jsxs)(\\"button\\",{onClick:ed,disabled:eh||G,className:\\"px-4 py-2 text-sm bg-indigo-600 text-white rounded hover:bg-indigo-700 shadow-sm flex items-center gap-2 disabled:opacity-50\\",children:[(0,s.jsx)(h.A,{size:18}),\\" Generar\\"]})]})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex flex-1 gap-4 overflow-hidden\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"w-72 bg-white rounded-xl shadow-sm border border-gray-200 flex flex-col hidden md:flex\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"p-3 border-b border-gray-100 bg-gray-50/50 rounded-t-xl space-y-2\\",children:[(0,s.jsx)(\\"div\\",{className:\\"flex justify-between items-center\\",children:(0,s.jsxs)(\\"h3\\",{className:\\"text-xs font-bold text-gray-500 uppercase tracking-wider\\",children:[\\"Plantilla (\\",en.length,\\")\\"]})}),(0,s.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,s.jsx)(\\"input\\",{type:\\"text\\",placeholder:\\"Buscar...\\",className:\\"w-full pl-8 pr-2 py-1.5 text-xs border border-gray-300 rounded-md outline-none focus:border-indigo-500\\",value:$,onChange:e=>U(e.target.value)}),(0,s.jsx)(b.A,{size:14,className:\\"absolute left-2.5 top-2 text-gray-400\\"})]}),(0,s.jsx)(\\"div\\",{className:\\"flex gap-1 overflow-x-auto pb-1 scrollbar-hide\\",children:[\\"ALL\\",\\"Vigilador\\",\\"Limpieza\\",\\"Supervisor\\"].map(e=>(0,s.jsx)(\\"button\\",{onClick:()=>F(e),className:`px-2 py-1 rounded text-[10px] font-bold whitespace-nowrap border ${B===e?\\"bg-indigo-100 text-indigo-700 border-indigo-200\\":\\"bg-white text-gray-500 border-gray-200\\"}`,children:\\"ALL\\"===e?\\"Todos\\":e},e))})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 overflow-y-auto p-2 space-y-2 scrollbar-thin bg-slate-50\\",children:[!eh&&en.map(e=>{let t=el(e.uid),a=\\"UNAVAILABLE\\"===t.status;return(0,s.jsxs)(\\"div\\",{draggable:!a,onDragStart:t=>{t.dataTransfer.setData(\\"employeeId\\",e.uid),t.dataTransfer.setData(\\"employeeName\\",e.name)},className:`p-2 bg-white border rounded-lg shadow-sm group flex justify-between items-center transition-all ${a?\\"opacity-60 bg-red-50 border-red-100 cursor-not-allowed\\":\\"hover:border-indigo-400 cursor-grab hover:shadow-md\\"}`,children:[(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-2 overflow-hidden\\",children:[(0,s.jsx)(\\"div\\",{className:`w-8 h-8 flex-shrink-0 rounded-full flex items-center justify-center text-xs font-bold border ${a?\\"bg-red-200 text-red-700 border-red-300\\":\\"bg-indigo-50 text-indigo-600 border-indigo-100\\"}`,children:e.name.charAt(0)}),(0,s.jsxs)(\\"div\\",{className:\\"min-w-0\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-xs font-bold text-gray-700 truncate\\",children:e.name}),(0,s.jsx)(\\"p\\",{className:\\"text-[9px] text-gray-400 uppercase font-medium truncate\\",children:e.role||\\"Sin Rol\\"})]})]}),(0,s.jsx)(\\"div\\",{className:\\"flex flex-col items-end\\",children:a?(0,s.jsxs)(\\"span\\",{className:\\"text-[9px] font-bold text-red-600 flex items-center gap-1 bg-red-100 px-1.5 py-0.5 rounded\\",children:[(0,s.jsx)(f.A,{size:10}),\\" LICENCIA\\"]}):(0,s.jsxs)(\\"div\\",{className:\\"text-right\\",children:[(0,s.jsxs)(\\"span\\",{className:`text-[10px] font-bold flex items-center justify-end gap-1 ${\\"OVERLOADED\\"===t.status?\\"text-amber-600\\":t.hours>0?\\"text-indigo-600\\":\\"text-emerald-600\\"}`,children:[t.hours>0?(0,s.jsx)(y.A,{size:10}):(0,s.jsx)(v.A,{size:10}),t.hours>0?\\"Ocupado\\":\\"Disponible\\"]}),(0,s.jsxs)(\\"span\\",{className:\\"text-[10px] text-slate-400 font-mono\\",children:[t.hours,\\" hs\\"]})]})})]},e.uid)}),eh&&(0,s.jsx)(\\"div\\",{className:\\"p-4 text-center text-xs text-gray-400 italic\\",children:\\"Seleccione un objetivo para asignar personal.\\"})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden relative flex flex-col\\",children:[(0,s.jsx)(\\"div\\",{className:\\"absolute top-2 right-2 z-10\\",children:eh&&(0,s.jsxs)(\\"div\\",{className:\\"bg-blue-50 border border-blue-200 text-blue-800 text-xs px-3 py-1 rounded-full shadow-sm flex items-center gap-1\\",children:[(0,s.jsx)(j.A,{size:12}),\\" Monitor (Solo Lectura)\\"]})}),(0,s.jsx)(es,{events:eu,isLoading:G,onEventClick:e=>{X(e.originalData),W(!0)},onDropInfo:eo,startHour:0,endHour:24,readOnly:eh})]})]}),J&&Y&&(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 backdrop-blur-sm\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-2xl w-full max-w-sm overflow-hidden\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"bg-gray-50 px-6 py-4 border-b border-gray-100 flex justify-between items-center\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"font-bold text-gray-800\\",children:\\"Gestionar Turno\\"}),(0,s.jsx)(\\"button\\",{onClick:()=>W(!1),children:(0,s.jsx)(N.A,{size:20,className:\\"text-gray-400 hover:text-gray-600\\"})})]}),(0,s.jsxs)(\\"div\\",{className:\\"p-6 space-y-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase\\",children:\\"Colaborador\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-lg font-bold text-indigo-900\\",children:\\"VACANTE\\"===Y.employeeName?\\"\\\\uD83D\\\\uDD34 VACANTE\\":Y.employeeName})]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase\\",children:\\"Inicio\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-sm font-mono\\",children:(0,d.GP)(Y.startTime instanceof D.Dc?Y.startTime.toDate():new Date(Y.startTime),\\"HH:mm\\")})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase\\",children:\\"Fin\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-sm font-mono\\",children:(0,d.GP)(Y.endTime instanceof D.Dc?Y.endTime.toDate():new Date(Y.endTime),\\"HH:mm\\")})]})]}),Y.isOvertime&&(0,s.jsxs)(\\"div\\",{className:\\"bg-amber-50 border border-amber-200 text-amber-800 text-xs p-2 rounded flex items-center gap-2\\",children:[(0,s.jsx)(A.A,{size:14}),\\" Horas Extra Autorizadas\\"]})]}),!eh&&(0,s.jsxs)(\\"div\\",{className:\\"bg-gray-50 px-6 py-4 flex justify-between gap-3\\",children:[(0,s.jsx)(\\"button\\",{onClick:em,className:\\"flex-1 flex items-center justify-center gap-2 bg-white border border-red-200 text-red-600 px-4 py-2 rounded-lg text-xs font-bold hover:bg-red-50 transition\\",children:\\"VACANTE\\"===Y.employeeId?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.A,{size:14}),\\" BORRAR VACANTE\\"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.A,{size:14}),\\" DESASIGNAR\\"]})}),(0,s.jsxs)(\\"button\\",{onClick:eg,className:\\"flex-1 flex items-center justify-center gap-2 bg-indigo-600 text-white px-4 py-2 rounded-lg text-xs font-bold hover:bg-indigo-700 transition\\",children:[(0,s.jsx)(p.A,{size:14}),\\" DUPLICAR\\"]})]})]})}),q&&(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 backdrop-blur-sm\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-2xl w-full max-w-md overflow-hidden\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"bg-indigo-50 px-6 py-4 border-b border-indigo-100 flex justify-between items-center\\",children:[(0,s.jsxs)(\\"h3\\",{className:\\"font-bold text-indigo-800 flex items-center gap-2\\",children:[(0,s.jsx)(p.A,{size:18}),\\" Copiar D\\\\xedas\\"]}),(0,s.jsx)(\\"button\\",{onClick:()=>Q(!1),children:(0,s.jsx)(N.A,{size:20,className:\\"text-gray-400 hover:text-gray-600\\"})})]}),(0,s.jsxs)(\\"div\\",{className:\\"p-6 space-y-4\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-sm text-gray-600\\",children:\\"Copiar estructura del d\\\\xeda origen al rango seleccionado.\\"}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase\\",children:\\"D\\\\xeda Modelo\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:\\"w-full border p-2 rounded\\",value:K.sourceDate,onChange:e=>ee({...K,sourceDate:e.target.value})})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-2 text-gray-400 justify-center\\",children:[(0,s.jsx)(w.A,{size:16}),\\" Aplica a \\",(0,s.jsx)(w.A,{size:16})]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase\\",children:\\"Desde\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:\\"w-full border p-2 rounded\\",value:K.targetStart,onChange:e=>ee({...K,targetStart:e.target.value})})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase\\",children:\\"Hasta\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:\\"w-full border p-2 rounded\\",value:K.targetEnd,onChange:e=>ee({...K,targetEnd:e.target.value})})]})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-400 uppercase mb-2 block\\",children:\\"Aplicar solo en:\\"}),(0,s.jsx)(\\"div\\",{className:\\"flex justify-between gap-1\\",children:[\\"D\\",\\"L\\",\\"M\\",\\"M\\",\\"J\\",\\"V\\",\\"S\\"].map((e,t)=>(0,s.jsx)(\\"button\\",{onClick:()=>{ee(e=>{let a=e.targetDays.includes(t)?e.targetDays.filter(e=>e!==t):[...e.targetDays,t];return{...e,targetDays:a.sort()}})},className:`w-9 h-9 rounded-lg text-xs font-bold transition-all ${K.targetDays.includes(t)?\\"bg-indigo-600 text-white shadow-md\\":\\"bg-white border border-slate-200 text-slate-400\\"}`,children:e},t))})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"bg-gray-50 px-6 py-4 flex justify-end gap-3\\",children:[(0,s.jsx)(\\"button\\",{onClick:()=>Q(!1),className:\\"px-4 py-2 text-gray-600 font-bold hover:bg-gray-100 rounded-lg\\",children:\\"Cancelar\\"}),(0,s.jsx)(\\"button\\",{onClick:ec,disabled:G,className:\\"px-4 py-2 bg-indigo-600 text-white font-bold rounded-lg hover:bg-indigo-700 shadow-md\\",children:\\"Confirmar Copia\\"})]})]})})]})]})})},858:(e,t,a)=>{\\"use strict\\";a.d(t,{g:()=>o});var s=a(7876),r=a(4232),i=a(9099),l=a(5176),n=a(7932);let o=(e,t=[\\"admin\\"])=>{let a=Array.isArray(t)?t:[t];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",a),t=>{let o=(0,i.useRouter)(),[d,c]=(0,r.useState)(!0),[x,m]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,l.hg)(n.j2,async e=>{if(!e)return void o.replace(\\"/\\");m(e);try{let t=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${t}`),a.includes(t)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${t}\' no autorizado.`),o.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),o.replace(\\"/\\")}});return()=>e()},[o]),d)?(0,s.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,s.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,s.jsx)(e,{...t,currentUser:x})}}},4572:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/dashboard\\",function(){return a(811)}])},8753:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>N});var s=a(7876);a(4232);var r=a(8230),i=a.n(r),l=a(9099),n=a(9423),o=a(8264),d=a(5201),c=a(9065),x=a(1538),m=a(4763),g=a(4560),u=a(8423),p=a(6068),h=a(5164),b=a(4302),f=a(3657),y=a(7932),v=a(6647);function j(){let e=(0,l.useRouter)(),{clients:t,selectedClientId:a,setClient:r}=(0,v.t)(),j=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:g.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:u.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,s.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,s.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,s.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,s.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,s.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,s.jsxs)(\\"select\\",{value:a,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,s.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),t.map(e=>(0,s.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,s.jsx)(h.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,s.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,s.jsx)(i(),{href:\\"/admin/home\\",children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,s.jsx)(b.A,{size:18}),\\" Inicio\\"]})}),j.map(t=>(0,s.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,s.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:t.title}),t.items.map(t=>(0,s.jsx)(i(),{href:t.href,children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===t.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,s.jsx)(t.icon,{size:16}),\\" \\",t.label]})},t.href))]},t.title))]}),(0,s.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,s.jsxs)(\\"button\\",{onClick:()=>y.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,s.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:t}){return(0,s.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,s.jsx)(j,{}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,s.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,s.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:t})}),(0,s.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,s.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,858,571,636,593,792],()=>e(e.s=4572)),_N_E=e.O()}]);"},{"name":"employees-dc4f1368b4c660b1.js","path":"apps/web/out/_next/static/chunks/pages/admin/employees-dc4f1368b4c660b1.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[83],{5316:(e,n,_)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/employees\\",function(){return _(5616)}])},5616:(e,n,_)=>{\\"use strict\\";_.r(n),_.d(n,{default:()=>i});var r=_(7876);_(4232);var s=_(858),t=_(8753),a=_(9123);let i=(0,s.g)(function(){return(0,r.jsx)(t.A,{title:\\"Gesti\\\\xf3n de Personal\\",children:(0,r.jsx)(a.G,{})})},[\\"admin\\",\\"hr_manager\\"])}},e=>{e.O(0,[212,995,636,593,792],()=>e(e.s=5316)),_N_E=e.O()}]);"},{"name":"home-df25a8b2d171f753.js","path":"apps/web/out/_next/static/chunks/pages/admin/home-df25a8b2d171f753.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[397],{5049:(e,s,a)=>{\\"use strict\\";a.d(s,{A:()=>t});let t=(0,a(7161).A)(\\"triangle-alert\\",[[\\"path\\",{d:\\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\\",key:\\"wmoenq\\"}],[\\"path\\",{d:\\"M12 9v4\\",key:\\"juzpu7\\"}],[\\"path\\",{d:\\"M12 17h.01\\",key:\\"p32p05\\"}]])},5802:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/home\\",function(){return a(9545)}])},6850:(e,s,a)=>{\\"use strict\\";a.d(s,{A:()=>t});let t=(0,a(7161).A)(\\"chevron-right\\",[[\\"path\\",{d:\\"m9 18 6-6-6-6\\",key:\\"mthhwq\\"}]])},8753:(e,s,a)=>{\\"use strict\\";a.d(s,{A:()=>w});var t=a(7876);a(4232);var l=a(8230),r=a.n(l),i=a(9099),n=a(9423),o=a(8264),d=a(5201),c=a(9065),x=a(1538),m=a(4763),h=a(4560),p=a(8423),b=a(6068),u=a(5164),g=a(4302),f=a(3657),v=a(7932),j=a(6647);function N(){let e=(0,i.useRouter)(),{clients:s,selectedClientId:a,setClient:l}=(0,j.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:h.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:p.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:b.A,label:\\"Usuarios Sistema\\"}]}];return(0,t.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,t.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,t.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,t.jsxs)(\\"select\\",{value:a,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),s.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,t.jsx)(u.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,t.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,t.jsx)(r(),{href:\\"/admin/home\\",children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,t.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),N.map(s=>(0,t.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,t.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:s.title}),s.items.map(s=>(0,t.jsx)(r(),{href:s.href,children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===s.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,t.jsx)(s.icon,{size:16}),\\" \\",s.label]})},s.href))]},s.title))]}),(0,t.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,t.jsxs)(\\"button\\",{onClick:()=>v.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,t.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function w({children:e,title:s}){return(0,t.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,t.jsx)(N,{}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,t.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,t.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:s})}),(0,t.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,t.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9545:(e,s,a)=>{\\"use strict\\";a.r(s),a.d(s,{default:()=>g});var t=a(7876);a(4232);var l=a(8230),r=a.n(l),i=a(8753),n=a(8423),o=a(5049),d=a(7161);let c=(0,d.A)(\\"shield-check\\",[[\\"path\\",{d:\\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\\",key:\\"oel41y\\"}],[\\"path\\",{d:\\"m9 12 2 2 4-4\\",key:\\"dzmm74\\"}]]),x=(0,d.A)(\\"user-minus\\",[[\\"path\\",{d:\\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\\",key:\\"1yyitq\\"}],[\\"circle\\",{cx:\\"9\\",cy:\\"7\\",r:\\"4\\",key:\\"nufk8\\"}],[\\"line\\",{x1:\\"22\\",x2:\\"16\\",y1:\\"11\\",y2:\\"11\\",key:\\"1shjgl\\"}]]);var m=a(8264),h=a(9065),p=a(1538),b=a(6068),u=a(6850);function g(){let e=[{name:\\"COBERTURA\\",value:\\"0%\\",icon:n.A,color:\\"text-emerald-500\\",bg:\\"bg-emerald-50\\"},{name:\\"VACANTES\\",value:\\"0\\",icon:o.A,color:\\"text-amber-500\\",bg:\\"bg-amber-50\\"},{name:\\"PERSONAL\\",value:\\"0\\",icon:c,color:\\"text-blue-500\\",bg:\\"bg-blue-50\\"},{name:\\"LICENCIAS\\",value:\\"0\\",icon:x,color:\\"text-rose-500\\",bg:\\"bg-rose-50\\"}],s=[{name:\\"Planificador\\",desc:\\"Gestionar turnos y cuadrantes\\",path:\\"/admin/dashboard\\",icon:m.A,color:\\"bg-indigo-600\\"},{name:\\"Clientes\\",desc:\\"Base de datos de servicios\\",path:\\"/admin/clients\\",icon:h.A,color:\\"bg-slate-800\\"},{name:\\"Personal\\",desc:\\"Legajos y RRHH\\",path:\\"/admin/employees\\",icon:p.A,color:\\"bg-indigo-500\\"},{name:\\"Auditor\\\\xeda\\",desc:\\"Logs de sistema\\",path:\\"/admin/audit\\",icon:b.A,color:\\"bg-slate-700\\"}];return(0,t.jsxs)(i.A,{title:\\"Centro de Mando\\",children:[(0,t.jsx)(\\"div\\",{className:\\"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8\\",children:e.map(e=>(0,t.jsxs)(\\"div\\",{className:\\"bg-white p-4 lg:p-6 rounded-[2rem] shadow-sm border border-slate-100 flex flex-col lg:flex-row items-center lg:items-center gap-3\\",children:[(0,t.jsx)(\\"div\\",{className:`p-3 rounded-2xl ${e.bg}`,children:(0,t.jsx)(e.icon,{className:e.color,size:20})}),(0,t.jsxs)(\\"div\\",{className:\\"text-center lg:text-left\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-slate-400 text-[9px] font-black uppercase tracking-widest\\",children:e.name}),(0,t.jsx)(\\"p\\",{className:\\"text-xl font-black text-slate-800\\",children:e.value})]})]},e.name))}),(0,t.jsxs)(\\"div\\",{className:\\"mb-10\\",children:[(0,t.jsx)(\\"h3\\",{className:\\"text-sm font-black text-slate-800 mb-4 px-2 uppercase tracking-widest opacity-50\\",children:\\"Accesos R\\\\xe1pidos\\"}),(0,t.jsx)(\\"div\\",{className:\\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\\",children:s.map(e=>(0,t.jsx)(r(),{href:e.path,children:(0,t.jsxs)(\\"div\\",{className:\\"group bg-white p-5 rounded-[2.5rem] border border-slate-100 shadow-sm hover:shadow-xl hover:border-indigo-100 transition-all cursor-pointer flex items-center gap-4\\",children:[(0,t.jsx)(\\"div\\",{className:`w-12 h-12 ${e.color} rounded-2xl flex items-center justify-center text-white shadow-lg group-hover:scale-110 transition-transform`,children:(0,t.jsx)(e.icon,{size:22})}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1\\",children:[(0,t.jsx)(\\"h4\\",{className:\\"font-bold text-slate-800 group-hover:text-indigo-600 transition-colors\\",children:e.name}),(0,t.jsx)(\\"p\\",{className:\\"text-[10px] text-slate-400 font-medium\\",children:e.desc})]}),(0,t.jsx)(u.A,{size:16,className:\\"text-slate-300 group-hover:text-indigo-400 transition-colors\\"})]})},e.path))})]}),(0,t.jsx)(\\"div\\",{className:\\"bg-slate-900 p-8 rounded-[3rem] text-white shadow-2xl relative overflow-hidden\\",children:(0,t.jsxs)(\\"div\\",{className:\\"relative z-10 flex flex-col md:flex-row md:items-center justify-between gap-6\\",children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h2\\",{className:\\"text-2xl font-bold mb-2\\",children:\\"Monitor Operativo\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-slate-400 text-sm max-w-sm\\",children:\\"La infraestructura de CronoApp se encuentra sincronizada con el motor de Google Firebase.\\"})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex items-center gap-3 px-6 py-3 bg-white/5 rounded-2xl border border-white/10\\",children:[(0,t.jsx)(\\"div\\",{className:\\"w-3 h-3 bg-emerald-500 rounded-full animate-pulse\\"}),(0,t.jsx)(\\"span\\",{className:\\"text-xs font-black uppercase tracking-widest text-emerald-400\\",children:\\"Sistema en l\\\\xednea\\"})]})]})})]})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=5802)),_N_E=e.O()}]);"},{"name":"labor-agreements-d4eaae60c15494a8.js","path":"apps/web/out/_next/static/chunks/pages/admin/labor-agreements-d4eaae60c15494a8.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[672],{858:(e,a,s)=>{\\"use strict\\";s.d(a,{g:()=>d});var t=s(7876),r=s(4232),l=s(9099),i=s(5176),n=s(7932);let d=(e,a=[\\"admin\\"])=>{let s=Array.isArray(a)?a:[a];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",s),a=>{let d=(0,l.useRouter)(),[o,c]=(0,r.useState)(!0),[x,h]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void d.replace(\\"/\\");h(e);try{let a=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${a}`),s.includes(a)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${a}\' no autorizado.`),d.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),d.replace(\\"/\\")}});return()=>e()},[d]),o)?(0,t.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,t.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,t.jsx)(e,{...a,currentUser:x})}}},2420:(e,a,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/labor-agreements\\",function(){return s(5711)}])},4015:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"trash-2\\",[[\\"path\\",{d:\\"M10 11v6\\",key:\\"nco0om\\"}],[\\"path\\",{d:\\"M14 11v6\\",key:\\"outv1u\\"}],[\\"path\\",{d:\\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\\",key:\\"miytrc\\"}],[\\"path\\",{d:\\"M3 6h18\\",key:\\"d0wm0j\\"}],[\\"path\\",{d:\\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\\",key:\\"e791ji\\"}]])},4104:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>r});var t=s(7876);function r({label:e,id:a,type:s=\\"text\\",rows:r=1,className:l,...i}){let n=\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 p-2 text-sm\\";return(0,t.jsxs)(\\"div\\",{className:`space-y-1 ${l}`,children:[(0,t.jsx)(\\"label\\",{htmlFor:a,className:\\"block text-sm font-medium text-gray-700\\",children:e}),\\"textarea\\"===s?(0,t.jsx)(\\"textarea\\",{id:a,className:n,rows:r,...i}):(0,t.jsx)(\\"input\\",{id:a,type:s,className:n,...i})]})}s(4232)},4893:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"pen\\",[[\\"path\\",{d:\\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\\",key:\\"1a8usu\\"}]])},5246:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"briefcase\\",[[\\"path\\",{d:\\"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16\\",key:\\"jecpp\\"}],[\\"rect\\",{width:\\"20\\",height:\\"14\\",x:\\"2\\",y:\\"6\\",rx:\\"2\\",key:\\"i6l2r4\\"}]])},5711:(e,a,s)=>{\\"use strict\\";s.r(a),s.d(a,{default:()=>N});var t=s(7876),r=s(4232),l=s(858),i=s(8753),n=s(2921),d=s(7932),o=s(4104),c=s(9120),x=s(7685),h=s(7161);let m=(0,h.A)(\\"cloud-download\\",[[\\"path\\",{d:\\"M12 13v8l-4-4\\",key:\\"1f5nwf\\"}],[\\"path\\",{d:\\"m12 21 4-4\\",key:\\"1lfcce\\"}],[\\"path\\",{d:\\"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284\\",key:\\"ui1hmy\\"}]]);var u=s(6346),g=s(4893),p=s(4015),y=s(5246),b=s(7104);let f=(0,h.A)(\\"moon\\",[[\\"path\\",{d:\\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\\",key:\\"kfwtm\\"}]]),j=(0,n.Qg)(d.Cn,\\"manageAgreements\\");function v(){let[e,a]=(0,r.useState)([]),[s,l]=(0,r.useState)(!1),[i,n]=(0,r.useState)(!1),[d,h]=(0,r.useState)(!1),[v,N]=(0,r.useState)({id:\\"\\",name:\\"\\",code:\\"\\",maxHoursWeekly:48,maxHoursMonthly:204,overtimeThresholdDaily:12,saturdayCutoffHour:13,nightShiftStart:21,nightShiftEnd:6}),A=async()=>{h(!0);try{let e=await j({action:\\"GET_ALL\\",payload:{}});a(e.data.data||[])}catch(e){console.error(e),x.Ay.error(\\"Error cargando convenios\\")}finally{h(!1)}};(0,r.useEffect)(()=>{A()},[]);let w=async()=>{let e=x.Ay.loading(\\"Importando convenios est\\\\xe1ndar...\\");try{let a=await j({action:\\"INITIALIZE_DEFAULTS\\",payload:{}});x.Ay.success(a.data.message,{id:e}),A()}catch(a){x.Ay.error(a.message,{id:e})}},k=async e=>{e.preventDefault();let a=x.Ay.loading(\\"Guardando...\\");try{i?await j({action:\\"UPDATE\\",payload:{id:v.id,data:v}}):await j({action:\\"CREATE\\",payload:v}),x.Ay.success(\\"Guardado correctamente\\",{id:a}),l(!1),A()}catch(e){x.Ay.error(e.message,{id:a})}},C=async e=>{if(confirm(\\"\\\\xbfEliminar convenio?\\"))try{await j({action:\\"DELETE\\",payload:{id:e}}),x.Ay.success(\\"Eliminado\\"),A()}catch(e){x.Ay.error(e.message)}};return(0,t.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex justify-between items-center bg-white p-6 rounded-xl shadow-sm border border-gray-200\\",children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h3\\",{className:\\"font-bold text-xl text-gray-800\\",children:\\"Reglas Laborales Activas\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-sm text-gray-500\\",children:\\"Define los l\\\\xedmites y par\\\\xe1metros de liquidaci\\\\xf3n.\\"})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex gap-3\\",children:[0===e.length&&!d&&(0,t.jsxs)(c.A,{onClick:w,className:\\"bg-white border border-gray-300 text-gray-700 hover:bg-gray-50 flex items-center gap-2\\",children:[(0,t.jsx)(m,{size:16}),\\" Cargar Est\\\\xe1ndares\\"]}),(0,t.jsxs)(c.A,{onClick:()=>{N({id:\\"\\",name:\\"\\",code:\\"\\",maxHoursWeekly:48,maxHoursMonthly:204,overtimeThresholdDaily:12,saturdayCutoffHour:13,nightShiftStart:21,nightShiftEnd:6}),n(!1),l(!0)},primary:!0,className:\\"flex items-center gap-2\\",children:[(0,t.jsx)(u.A,{size:16}),\\" Nuevo Convenio\\"]})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6\\",children:[e.map(e=>(0,t.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl border border-gray-200 shadow-sm hover:shadow-md transition-all relative overflow-hidden group\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"p-5 border-b border-gray-100 bg-gray-50 flex justify-between items-start\\",children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h4\\",{className:\\"font-bold text-lg text-indigo-700\\",children:e.name}),(0,t.jsx)(\\"span\\",{className:\\"text-xs font-mono bg-white border px-2 py-0.5 rounded text-slate-500\\",children:e.code})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity\\",children:[(0,t.jsx)(\\"button\\",{onClick:()=>{N(e),n(!0),l(!0)},className:\\"text-gray-400 hover:text-indigo-600\\",children:(0,t.jsx)(g.A,{size:16})}),(0,t.jsx)(\\"button\\",{onClick:()=>C(e.id),className:\\"text-gray-400 hover:text-red-600\\",children:(0,t.jsx)(p.A,{size:16})})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"p-5 space-y-3\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex items-center justify-between text-sm\\",children:[(0,t.jsxs)(\\"span\\",{className:\\"text-gray-500 flex items-center gap-2\\",children:[(0,t.jsx)(y.A,{size:14}),\\" Semanal\\"]}),(0,t.jsxs)(\\"span\\",{className:\\"font-bold text-gray-800\\",children:[e.maxHoursWeekly,\\" hs\\"]})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex items-center justify-between text-sm\\",children:[(0,t.jsxs)(\\"span\\",{className:\\"text-gray-500 flex items-center gap-2\\",children:[(0,t.jsx)(b.A,{size:14}),\\" Mensual\\"]}),(0,t.jsxs)(\\"span\\",{className:\\"font-bold text-gray-800\\",children:[e.maxHoursMonthly,\\" hs\\"]})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex items-center justify-between text-sm\\",children:[(0,t.jsxs)(\\"span\\",{className:\\"text-gray-500 flex items-center gap-2\\",children:[(0,t.jsx)(f,{size:14}),\\" Nocturnidad\\"]}),(0,t.jsxs)(\\"span\\",{className:\\"font-bold text-gray-800\\",children:[e.nightShiftStart,\\":00 - \\",e.nightShiftEnd,\\":00\\"]})]})]})]},e.id)),0===e.length&&!d&&(0,t.jsx)(\\"div\\",{className:\\"col-span-full p-12 text-center text-gray-400 border-2 border-dashed rounded-xl\\",children:\'No hay convenios cargados. Usa el bot\\\\xf3n \\"Cargar Est\\\\xe1ndares\\" para iniciar.\'})]}),s&&(0,t.jsx)(\\"div\\",{className:\\"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50 backdrop-blur-sm\\",children:(0,t.jsxs)(\\"div\\",{className:\\"bg-white p-8 rounded-2xl w-full max-w-lg shadow-2xl\\",children:[(0,t.jsx)(\\"h3\\",{className:\\"text-xl font-bold mb-6 text-gray-800\\",children:i?\\"Editar Regla\\":\\"Nueva Regla Laboral\\"}),(0,t.jsxs)(\\"form\\",{onSubmit:k,className:\\"space-y-4\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,t.jsx)(\\"div\\",{className:\\"col-span-2\\",children:(0,t.jsx)(o.A,{label:\\"Nombre (Ej: Seguridad Privada)\\",id:\\"name\\",value:v.name,onChange:e=>N({...v,name:e.target.value}),required:!0})}),(0,t.jsx)(o.A,{label:\\"C\\\\xf3digo (Ej: SUVICO)\\",id:\\"code\\",value:v.code,onChange:e=>N({...v,code:e.target.value}),required:!0}),(0,t.jsx)(o.A,{label:\\"L\\\\xedmite Diario (Ej: 12)\\",type:\\"number\\",id:\\"daily\\",value:v.overtimeThresholdDaily,onChange:e=>N({...v,overtimeThresholdDaily:+e.target.value}),required:!0}),(0,t.jsx)(o.A,{label:\\"Max Semanal (Ej: 48)\\",type:\\"number\\",id:\\"weekly\\",value:v.maxHoursWeekly,onChange:e=>N({...v,maxHoursWeekly:+e.target.value}),required:!0}),(0,t.jsx)(o.A,{label:\\"Max Mensual (Ej: 204)\\",type:\\"number\\",id:\\"monthly\\",value:v.maxHoursMonthly,onChange:e=>N({...v,maxHoursMonthly:+e.target.value}),required:!0}),(0,t.jsxs)(\\"div\\",{className:\\"col-span-2 border-t pt-4 mt-2\\",children:[(0,t.jsx)(\\"h4\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-3\\",children:\\"Extras y Nocturnidad\\"}),(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-3 gap-3\\",children:[(0,t.jsx)(o.A,{label:\\"Corte S\\\\xe1b.\\",type:\\"number\\",id:\\"sat\\",value:v.saturdayCutoffHour,onChange:e=>N({...v,saturdayCutoffHour:+e.target.value}),required:!0}),(0,t.jsx)(o.A,{label:\\"Inicio Noche\\",type:\\"number\\",id:\\"ns\\",value:v.nightShiftStart,onChange:e=>N({...v,nightShiftStart:+e.target.value}),required:!0}),(0,t.jsx)(o.A,{label:\\"Fin Noche\\",type:\\"number\\",id:\\"ne\\",value:v.nightShiftEnd,onChange:e=>N({...v,nightShiftEnd:+e.target.value}),required:!0})]})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex justify-end gap-3 mt-8\\",children:[(0,t.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>l(!1),className:\\"px-5 py-2.5 text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200 font-medium\\",children:\\"Cancelar\\"}),(0,t.jsx)(c.A,{type:\\"submit\\",primary:!0,children:\\"Guardar Regla\\"})]})]})]})})]})}let N=(0,l.g)(function(){return(0,t.jsx)(i.A,{title:\\"Gesti\\\\xf3n de Convenios Colectivos\\",children:(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(v,{})})})},[\\"admin\\",\\"hr_manager\\"])},6346:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"plus\\",[[\\"path\\",{d:\\"M5 12h14\\",key:\\"1ays0h\\"}],[\\"path\\",{d:\\"M12 5v14\\",key:\\"s699le\\"}]])},7104:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>t});let t=(0,s(7161).A)(\\"clock\\",[[\\"path\\",{d:\\"M12 6v6l4 2\\",key:\\"mmk7yg\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}]])},8753:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>N});var t=s(7876);s(4232);var r=s(8230),l=s.n(r),i=s(9099),n=s(9423),d=s(8264),o=s(5201),c=s(9065),x=s(1538),h=s(4763),m=s(4560),u=s(8423),g=s(6068),p=s(5164),y=s(4302),b=s(3657),f=s(7932),j=s(6647);function v(){let e=(0,i.useRouter)(),{clients:a,selectedClientId:s,setClient:r}=(0,j.t)(),v=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:d.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:h.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:u.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:g.A,label:\\"Usuarios Sistema\\"}]}];return(0,t.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,t.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,t.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,t.jsxs)(\\"select\\",{value:s,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),a.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,t.jsx)(p.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,t.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,t.jsx)(l(),{href:\\"/admin/home\\",children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,t.jsx)(y.A,{size:18}),\\" Inicio\\"]})}),v.map(a=>(0,t.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,t.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:a.title}),a.items.map(a=>(0,t.jsx)(l(),{href:a.href,children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===a.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,t.jsx)(a.icon,{size:16}),\\" \\",a.label]})},a.href))]},a.title))]}),(0,t.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,t.jsxs)(\\"button\\",{onClick:()=>f.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,t.jsx)(b.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:a}){return(0,t.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,t.jsx)(v,{}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,t.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,t.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:a})}),(0,t.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,t.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9120:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>r});var t=s(7876);function r({primary:e=!0,children:a,className:s,disabled:r,...l}){return(0,t.jsx)(\\"button\\",{className:`px-4 py-2 rounded-lg font-semibold transition-colors duration-150 ${e?\\"bg-indigo-600 text-white hover:bg-indigo-700 disabled:bg-indigo-300\\":\\"bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:bg-gray-100\\"} ${s||\\"\\"}`,disabled:r,...l,children:a})}s(4232)}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=2420)),_N_E=e.O()}]);"},{"name":"[id]-29fc8b3f69e6d8e9.js","path":"apps/web/out/_next/static/chunks/pages/admin/objective-detail/[id]-29fc8b3f69e6d8e9.js","area":"FRONTEND","folder":"OBJECTIVE-DETAIL","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[645],{660:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"file-text\\",[[\\"path\\",{d:\\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\\",key:\\"1oefj6\\"}],[\\"path\\",{d:\\"M14 2v5a1 1 0 0 0 1 1h5\\",key:\\"wfsgrz\\"}],[\\"path\\",{d:\\"M10 9H8\\",key:\\"b1mrlr\\"}],[\\"path\\",{d:\\"M16 13H8\\",key:\\"t4e002\\"}],[\\"path\\",{d:\\"M16 17H8\\",key:\\"z1uh3a\\"}]])},858:(e,t,a)=>{\\"use strict\\";a.d(t,{g:()=>n});var s=a(7876),r=a(4232),i=a(9099),l=a(5176),d=a(7932);let n=(e,t=[\\"admin\\"])=>{let a=Array.isArray(t)?t:[t];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",a),t=>{let n=(0,i.useRouter)(),[o,c]=(0,r.useState)(!0),[x,u]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,l.hg)(d.j2,async e=>{if(!e)return void n.replace(\\"/\\");u(e);try{let t=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${t}`),a.includes(t)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${t}\' no autorizado.`),n.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),n.replace(\\"/\\")}});return()=>e()},[n]),o)?(0,s.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,s.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,s.jsx)(e,{...t,currentUser:x})}}},3684:(e,t,a)=>{\\"use strict\\";a.d(t,{$:()=>l});var s=a(7876),r=a(4232),i=a(7685);let l=({address:e,onCoordinatesSelected:t,onClose:a,isOpen:l})=>{let[d,n]=(0,r.useState)(!1),o=\\"AIzaSyA0Nl6OOJI8swRVQ8uzAKpPHdE2zvEscOE\\";if(!l)return null;let c=async()=>{if(!e.trim())return void i.Ay.error(\\"Ingrese una direcci\\\\xf3n v\\\\xe1lida para buscar.\\");if(!o||\\"\\"===o.trim()){i.Ay.error(\\"Error: Falta la clave de Google Maps (NEXT_PUBLIC_GOOGLE_MAPS_API_KEY).\\"),console.error(\\"GeocodingSelector: Missing Google Maps API Key.\\");return}n(!0);let s=encodeURIComponent(e),r=`https://maps.googleapis.com/maps/api/geocode/json?address=${s}&key=${o}`;try{let s=await fetch(r),l=await s.json();if(\\"OK\\"===l.status&&l.results.length>0){let{lat:s,lng:r}=l.results[0].geometry.location,d=s.toFixed(6),n=r.toFixed(6);t(d,n),i.Ay.success(`Coordenadas asignadas a: ${e}`),a()}else i.Ay.error(\\"No se encontraron coordenadas para la direcci\\\\xf3n proporcionada.\\")}catch(e){console.error(\\"Error al consultar la API de Google:\\",e),i.Ay.error(\\"Error de red al buscar coordenadas.\\")}finally{n(!1)}};return(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white p-6 rounded-lg shadow-xl w-full max-w-md\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-xl font-bold mb-4 text-gray-800\\",children:\\"Buscar Coordenadas\\"}),(0,s.jsxs)(\\"p\\",{className:\\"text-sm text-gray-600 mb-4\\",children:[\\"Direcci\\\\xf3n a buscar: \\",(0,s.jsx)(\\"span\\",{className:\\"font-semibold text-indigo-600\\",children:e})]}),(0,s.jsx)(\\"button\\",{onClick:c,disabled:d||!e.trim(),className:`w-full py-2 px-4 rounded-md text-white font-medium transition duration-200 ${d||!e.trim()?\\"bg-indigo-400 cursor-not-allowed\\":\\"bg-indigo-600 hover:bg-indigo-700\\"}`,children:d?\\"Buscando...\\":\\"Confirmar B\\\\xfasqueda en Mapa\\"}),(0,s.jsx)(\\"button\\",{onClick:a,className:\\"mt-3 w-full py-2 px-4 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition duration-200\\",children:\\"Cancelar\\"})]})})}},4015:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"trash-2\\",[[\\"path\\",{d:\\"M10 11v6\\",key:\\"nco0om\\"}],[\\"path\\",{d:\\"M14 11v6\\",key:\\"outv1u\\"}],[\\"path\\",{d:\\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\\",key:\\"miytrc\\"}],[\\"path\\",{d:\\"M3 6h18\\",key:\\"d0wm0j\\"}],[\\"path\\",{d:\\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\\",key:\\"e791ji\\"}]])},4417:(e,t,a)=>{\\"use strict\\";a.r(t),a.d(t,{default:()=>k});var s=a(7876),r=a(4232),i=a(9099),l=a(858),d=a(8753),n=a(6647),o=a(7932),c=a(7685),x=a(3684),u=a(4893),m=a(9370),h=a(7161);let p=(0,h.A)(\\"layout-dashboard\\",[[\\"rect\\",{width:\\"7\\",height:\\"9\\",x:\\"3\\",y:\\"3\\",rx:\\"1\\",key:\\"10lvy0\\"}],[\\"rect\\",{width:\\"7\\",height:\\"5\\",x:\\"14\\",y:\\"3\\",rx:\\"1\\",key:\\"16une8\\"}],[\\"rect\\",{width:\\"7\\",height:\\"9\\",x:\\"14\\",y:\\"12\\",rx:\\"1\\",key:\\"1hutg5\\"}],[\\"rect\\",{width:\\"7\\",height:\\"5\\",x:\\"3\\",y:\\"16\\",rx:\\"1\\",key:\\"ldoo1y\\"}]]),g=(0,h.A)(\\"settings\\",[[\\"path\\",{d:\\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\\",key:\\"1i5ecw\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"3\\",key:\\"1v7zrd\\"}]]);var b=a(6346),y=a(4015),f=a(660),j=a(1538);let v=(0,h.A)(\\"calendar-days\\",[[\\"path\\",{d:\\"M8 2v4\\",key:\\"1cmpym\\"}],[\\"path\\",{d:\\"M16 2v4\\",key:\\"4m81vk\\"}],[\\"rect\\",{width:\\"18\\",height:\\"18\\",x:\\"3\\",y:\\"4\\",rx:\\"2\\",key:\\"1hopcy\\"}],[\\"path\\",{d:\\"M3 10h18\\",key:\\"8toen8\\"}],[\\"path\\",{d:\\"M8 14h.01\\",key:\\"6423bh\\"}],[\\"path\\",{d:\\"M12 14h.01\\",key:\\"1etili\\"}],[\\"path\\",{d:\\"M16 14h.01\\",key:\\"1gbofw\\"}],[\\"path\\",{d:\\"M8 18h.01\\",key:\\"lrp35t\\"}],[\\"path\\",{d:\\"M12 18h.01\\",key:\\"mhygvu\\"}],[\\"path\\",{d:\\"M16 18h.01\\",key:\\"kzsmim\\"}]]);var N=a(7104),w=a(6514),A=a(5002);let k=(0,l.g)(function(){let{id:e}=(0,i.useRouter)().query,{clients:t}=(0,n.t)(),[a,l]=(0,r.useState)(null),[h,k]=(0,r.useState)([]),[S,C]=(0,r.useState)([]),[D,M]=(0,r.useState)([]),[z,I]=(0,r.useState)(!0),[T,E]=(0,r.useState)(\\"operations\\"),[O,q]=(0,r.useState)(!1),[H,P]=(0,r.useState)(null),[G,$]=(0,r.useState)(!1),[_,R]=(0,r.useState)(!1),[F,V]=(0,r.useState)(!1),[L,U]=(0,r.useState)(!1),[B,W]=(0,r.useState)({name:\\"\\",hours:720,isActive:!0,quantity:1,days:[0,1,2,3,4,5,6],startDate:\\"\\",endDate:\\"\\"}),[K,Y]=(0,r.useState)({totalVacancies:0,estimatedHours:0}),[J,X]=(0,r.useState)({employeeId:\\"\\",start:\\"\\",end:\\"\\"}),[Q,Z]=(0,r.useState)({id:\\"\\",name:\\"\\",code:\\"\\",startTime:\\"07:00\\",durationHours:12}),[ee,et]=(0,r.useState)({name:\\"\\",address:\\"\\",clientId:\\"\\",latitude:\\"\\",longitude:\\"\\"}),[ea,es]=(0,r.useState)(null),[er,ei]=(0,r.useState)([]),[el,ed]=(0,r.useState)(!1),en=async()=>{if(e)try{let[t,a]=await Promise.all([(0,o.bY)(e),(0,o.Ri)(e)]);l(t.objective),k(t.shifts),C(a)}catch(e){console.error(e)}finally{I(!1)}},eo=async()=>{try{let e=await (0,o.r6)({action:\\"GET_ALL_EMPLOYEES\\",payload:{}});M(e.data.data||[])}catch(e){console.error(e)}};(0,r.useEffect)(()=>{en(),eo();let e=setInterval(en,6e4);return()=>clearInterval(e)},[e]),(0,r.useEffect)(()=>{if(B.startDate&&B.quantity){let e=new Date(B.startDate),t=B.endDate?new Date(B.endDate):new Date(e.getFullYear(),e.getMonth()+1,0),a=0;for(let s=new Date(e);s<=t;s.setDate(s.getDate()+1))B.days.includes(s.getDay())&&a++;let s=24*B.quantity;Y({totalVacancies:a*B.quantity,estimatedHours:a*s})}},[B]);let ec=e=>e?e.toDate?e.toDate():e instanceof Date?e:\\"string\\"==typeof e?new Date(e):e.seconds?new Date(1e3*e.seconds):new Date:new Date,ex=e=>ec(e).toLocaleTimeString(\\"es-AR\\",{hour:\\"2-digit\\",minute:\\"2-digit\\",timeZone:\\"UTC\\"}),eu=h.filter(e=>\\"InProgress\\"===e.status),em=h.filter(e=>\\"Assigned\\"===e.status&&ec(e.startTime)>new Date),eh=h.filter(e=>\\"Canceled\\"===e.status||\\"Assigned\\"===e.status&&new Date>ec(e.startTime)).length>0,ep=async e=>{if(e.preventDefault(),!a)return;let t=c.Ay.loading(\\"Actualizando...\\");try{await (0,o.updateObjective)(a.id,{name:ee.name,address:ee.address,clientId:ee.clientId,location:{latitude:parseFloat(ee.latitude),longitude:parseFloat(ee.longitude)}}),c.Ay.success(\\"Sede actualizada\\",{id:t}),V(!1),en()}catch(e){c.Ay.error(e.message,{id:t})}},eg=async t=>{if(t.preventDefault(),!B.startDate)return void c.Ay.error(\\"Fecha de inicio obligatoria\\");let a=c.Ay.loading(\\"Procesando...\\");try{let t={name:B.name,totalHours:B.hours,isActive:B.isActive,quantity:B.quantity,daysOfWeek:B.days,startDate:new Date(B.startDate).toISOString(),endDate:B.endDate?new Date(B.endDate).toISOString():void 0};H?(await (0,o.updateServiceContract)(H.id,t),c.Ay.success(\\"Servicio actualizado\\",{id:a})):(await (0,o.createServiceForObjective)({objectiveId:e,...t}),c.Ay.success(\\"Servicio creado\\",{id:a})),q(!1),P(null),en()}catch(e){c.Ay.error(e.message,{id:a})}},eb=async e=>{if(confirm(\\"\\\\xbfEliminar servicio?\\"))try{await (0,o.deleteServiceContract)(e),c.Ay.success(\\"Eliminado\\"),en()}catch(e){c.Ay.error(e.message)}},ey=async e=>{es(e),ei(await (0,o.getShiftTypes)(e.id)),Z({id:\\"\\",name:\\"\\",code:\\"\\",startTime:\\"07:00\\",durationHours:12}),ed(!1),R(!0)},ef=async e=>{if(e.preventDefault(),!ea)return;let t=c.Ay.loading(\\"Guardando...\\");try{if(el)await (0,o.updateShiftType)(Q.id,{...Q}),c.Ay.success(\\"Actualizado\\",{id:t});else{let e=(await (0,o.createShiftType)({contractId:ea.id,color:\\"#4F46E5\\",...Q})).data.data,a=ec(ea.startDate),s=ea.endDate?ec(ea.endDate):void 0;await (0,o.createPattern)({contractId:ea.id,shiftTypeId:e.id,daysOfWeek:ea.daysOfWeek||[0,1,2,3,4,5,6],quantity:1,validFrom:a.toISOString(),validTo:s?.toISOString()}),c.Ay.success(\\"Modalidad y Regla creadas\\",{id:t})}let e=await (0,o.getShiftTypes)(ea.id);ei(e),el||Z({id:\\"\\",name:\\"\\",code:\\"\\",startTime:\\"07:00\\",durationHours:12}),ed(!1)}catch(e){c.Ay.error(e.message,{id:t})}},ej=async e=>{confirm(\\"\\\\xbfBorrar?\\")&&(await (0,o.deleteShiftType)(e),ea&&ei(await (0,o.getShiftTypes)(ea.id)))},ev=async e=>{if(e.preventDefault(),!a)return;let t=D.find(e=>e.uid===J.employeeId);if(!t)return c.Ay.error(\\"Seleccione empleado\\");let s=c.Ay.loading(\\"Asignando...\\");try{await (0,o.mm)({employeeId:t.uid,employeeName:t.name,objectiveId:a.id,objectiveName:a.name,startTime:new Date(J.start),endTime:new Date(J.end),status:\\"Assigned\\"}),c.Ay.success(\\"Turno creado\\",{id:s}),$(!1),en()}catch(e){c.Ay.error(e.message,{id:s})}};return z?(0,s.jsx)(d.A,{title:\\"Cargando...\\",children:\\"Loading...\\"}):a?(0,s.jsx)(d.A,{title:`Torre: ${a.name}`,children:(0,s.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,s.jsx)(\\"div\\",{className:`rounded-2xl p-6 text-white shadow-lg relative overflow-hidden transition-colors duration-500 ${eh?\\"bg-gradient-to-r from-red-600 to-rose-600\\":\\"bg-gradient-to-r from-slate-800 to-indigo-900\\"}`,children:(0,s.jsxs)(\\"div\\",{className:\\"relative z-10 flex flex-col md:flex-row justify-between items-start md:items-center gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-3 mb-1\\",children:[(0,s.jsx)(\\"h2\\",{className:\\"text-3xl font-bold\\",children:a.name}),(0,s.jsx)(\\"button\\",{onClick:()=>{a&&(et({name:a.name,address:a.address,clientId:a.clientId,latitude:String(a.location.latitude),longitude:String(a.location.longitude)}),V(!0))},className:\\"p-1.5 bg-white/20 rounded-lg hover:bg-white/30 transition border border-white/30\\",title:\\"Editar Sede\\",children:(0,s.jsx)(u.A,{size:18})}),eh&&(0,s.jsx)(\\"span\\",{className:\\"bg-white/20 px-2 py-0.5 rounded text-xs font-bold animate-pulse\\",children:\\"ALERTA\\"})]}),(0,s.jsxs)(\\"p\\",{className:\\"text-white/80 flex items-center text-sm\\",children:[(0,s.jsx)(m.A,{className:\\"w-4 h-4 mr-1\\"}),\\" \\",a.address]})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex gap-3\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"bg-white/10 backdrop-blur-md rounded-lg p-3 text-center min-w-[100px]\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-xs text-white/70 font-bold uppercase\\",children:\\"En Servicio\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-2xl font-bold\\",children:eu.length})]}),(0,s.jsxs)(\\"div\\",{className:\\"bg-white/10 backdrop-blur-md rounded-lg p-3 text-center min-w-[100px]\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-xs text-white/70 font-bold uppercase\\",children:\\"Pendientes\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-2xl font-bold\\",children:em.length})]})]})]})}),(0,s.jsxs)(\\"div\\",{className:\\"flex border-b border-gray-200\\",children:[(0,s.jsxs)(\\"button\\",{onClick:()=>E(\\"operations\\"),className:`px-6 py-3 border-b-2 flex gap-2 ${\\"operations\\"===T?\\"border-indigo-600 text-indigo-600\\":\\"border-transparent\\"}`,children:[(0,s.jsx)(p,{size:18}),\\" Operaciones\\"]}),(0,s.jsxs)(\\"button\\",{onClick:()=>E(\\"config\\"),className:`px-6 py-3 border-b-2 flex gap-2 ${\\"config\\"===T?\\"border-indigo-600 text-indigo-600\\":\\"border-transparent\\"}`,children:[(0,s.jsx)(g,{size:18}),\\" Configuraci\\\\xf3n\\"]})]}),\\"operations\\"===T&&(0,s.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,s.jsx)(\\"div\\",{className:\\"flex justify-end\\",children:(0,s.jsxs)(\\"button\\",{onClick:()=>$(!0),className:\\"bg-green-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 hover:bg-green-700 font-bold shadow-sm\\",children:[(0,s.jsx)(b.A,{size:18}),\\" Asignar Turno Manual\\"]})}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-1 lg:grid-cols-2 gap-6\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden\\",children:[(0,s.jsx)(\\"div\\",{className:\\"px-5 py-3 border-b bg-green-50\\",children:(0,s.jsx)(\\"h3\\",{className:\\"font-bold text-green-800\\",children:\\"En Servicio\\"})}),(0,s.jsxs)(\\"div\\",{className:\\"divide-y\\",children:[0===eu.length&&(0,s.jsx)(\\"p\\",{className:\\"p-4 text-center text-gray-400\\",children:\\"Sin actividad.\\"}),eu.map(e=>(0,s.jsxs)(\\"div\\",{className:\\"p-4 flex justify-between\\",children:[(0,s.jsx)(\\"span\\",{className:\\"font-bold\\",children:e.employeeName}),(0,s.jsx)(\\"span\\",{className:\\"font-mono text-green-700\\",children:ex(e.checkInTime)})]},e.id))]})]}),(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden\\",children:[(0,s.jsx)(\\"div\\",{className:\\"px-5 py-3 border-b bg-blue-50\\",children:(0,s.jsx)(\\"h3\\",{className:\\"font-bold text-blue-800\\",children:\\"Pr\\\\xf3ximos\\"})}),(0,s.jsxs)(\\"div\\",{className:\\"divide-y\\",children:[0===em.length&&(0,s.jsx)(\\"p\\",{className:\\"p-4 text-center text-gray-400\\",children:\\"Sin ingresos.\\"}),em.map(e=>(0,s.jsxs)(\\"div\\",{className:\\"p-4 flex justify-between\\",children:[(0,s.jsx)(\\"span\\",{className:\\"font-medium\\",children:e.employeeName}),(0,s.jsx)(\\"span\\",{className:\\"font-mono text-indigo-600\\",children:ex(e.startTime)})]},e.id))]})]})]})]}),\\"config\\"===T&&(0,s.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between items-center\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-lg font-bold\\",children:\\"Servicios Contratados\\"}),(0,s.jsxs)(\\"button\\",{onClick:()=>{P(null),W({name:\\"\\",hours:720,isActive:!0,quantity:1,days:[0,1,2,3,4,5,6],startDate:new Date().toISOString().split(\\"T\\")[0],endDate:\\"\\"}),q(!0)},className:\\"bg-indigo-600 text-white px-4 py-2 rounded-lg flex gap-2\\",children:[(0,s.jsx)(b.A,{size:18}),\\" Nuevo Servicio\\"]})]}),(0,s.jsx)(\\"div\\",{className:\\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\\",children:S.map(e=>{var t;return(0,s.jsxs)(\\"div\\",{className:\\"bg-white p-5 rounded-xl border border-slate-200 shadow-sm relative group hover:shadow-md transition-all\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"absolute top-4 right-4 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity\\",children:[(0,s.jsx)(\\"button\\",{onClick:()=>{let t;return P(e),t=e=>e?ec(e).toISOString().split(\\"T\\")[0]:\\"\\",void(W({name:e.name,hours:e.totalHoursPerMonth,isActive:e.isActive,quantity:e.quantity||1,days:e.daysOfWeek||[0,1,2,3,4,5,6],startDate:t(e.startDate),endDate:t(e.endDate)}),q(!0))},className:\\"text-gray-400 hover:text-indigo-600\\",children:(0,s.jsx)(u.A,{size:16})}),(0,s.jsx)(\\"button\\",{onClick:()=>eb(e.id),className:\\"text-gray-400 hover:text-red-600\\",children:(0,s.jsx)(y.A,{size:16})})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex items-center gap-3 mb-4\\",children:[(0,s.jsx)(\\"div\\",{className:\\"p-2 bg-indigo-50 text-indigo-600 rounded-lg\\",children:(0,s.jsx)(f.A,{size:20})}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"h4\\",{className:\\"font-bold text-slate-800 leading-tight\\",children:e.name}),(0,s.jsx)(\\"span\\",{className:`text-[10px] px-2 py-0.5 rounded-full font-bold ${e.isActive?\\"bg-green-100 text-green-700\\":\\"bg-gray-100 text-gray-500\\"}`,children:e.isActive?\\"ACTIVO\\":\\"INACTIVO\\"})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"space-y-2 text-sm text-slate-600 mb-4 bg-slate-50 p-3 rounded-lg\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between\\",children:[(0,s.jsxs)(\\"span\\",{className:\\"flex items-center gap-2 text-xs uppercase font-bold text-slate-400\\",children:[(0,s.jsx)(j.A,{size:14}),\\" Dotaci\\\\xf3n\\"]}),(0,s.jsxs)(\\"span\\",{className:\\"font-bold\\",children:[e.quantity||1,\\" Pers.\\"]})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between\\",children:[(0,s.jsxs)(\\"span\\",{className:\\"flex items-center gap-2 text-xs uppercase font-bold text-slate-400\\",children:[(0,s.jsx)(v,{size:14}),\\" Cobertura\\"]}),(0,s.jsx)(\\"div\\",{className:\\"flex gap-0.5\\",children:7===(t=e.daysOfWeek||[]).length?(0,s.jsx)(\\"span\\",{className:\\"text-xs text-green-600 font-medium\\",children:\\"Todos los d\\\\xedas (24x7)\\"}):(0,s.jsx)(\\"div\\",{className:\\"flex gap-0.5\\",children:[\\"D\\",\\"L\\",\\"M\\",\\"M\\",\\"J\\",\\"V\\",\\"S\\"].map((e,a)=>(0,s.jsx)(\\"span\\",{className:`text-[9px] w-4 h-4 flex items-center justify-center rounded-sm ${t.includes(a)?\\"bg-indigo-100 text-indigo-700 font-bold\\":\\"bg-gray-50 text-gray-300\\"}`,children:e},a))})})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between\\",children:[(0,s.jsxs)(\\"span\\",{className:\\"flex items-center gap-2 text-xs uppercase font-bold text-slate-400\\",children:[(0,s.jsx)(N.A,{size:14}),\\" Total\\"]}),(0,s.jsxs)(\\"span\\",{className:\\"font-bold\\",children:[e.totalHoursPerMonth,\\" hs\\"]})]})]}),(0,s.jsx)(\\"div\\",{className:\\"pt-3 border-t border-slate-100\\",children:(0,s.jsx)(\\"button\\",{onClick:()=>ey(e),className:\\"w-full py-2 text-xs font-bold text-indigo-600 bg-indigo-50 rounded hover:bg-indigo-100 transition text-center block\\",children:\\"Gestionar Turnos Base\\"})})]},e.id)})})]}),F&&(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl p-6 w-full max-w-md\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-lg font-bold mb-4\\",children:\\"Editar Sede\\"}),(0,s.jsxs)(\\"form\\",{onSubmit:ep,className:\\"space-y-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-500\\",children:\\"Cliente\\"}),(0,s.jsxs)(\\"select\\",{className:\\"w-full border p-2 rounded bg-white\\",value:ee.clientId,onChange:e=>et({...ee,clientId:e.target.value}),required:!0,children:[(0,s.jsx)(\\"option\\",{value:\\"\\",disabled:!0,children:\\"Seleccione...\\"}),t.map(e=>(0,s.jsx)(\\"option\\",{value:e.id,children:e.businessName},e.id))]})]}),(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded\\",value:ee.name,onChange:e=>et({...ee,name:e.target.value}),placeholder:\\"Nombre\\",required:!0}),(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded\\",value:ee.address,onChange:e=>et({...ee,address:e.target.value}),placeholder:\\"Direcci\\\\xf3n\\",required:!0}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-2\\",children:[(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded bg-gray-50\\",value:ee.latitude,readOnly:!0}),(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded bg-gray-50\\",value:ee.longitude,readOnly:!0})]}),(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>U(!0),className:\\"w-full bg-green-600 text-white py-2 rounded-lg text-sm font-bold\\",children:\\"Actualizar Mapa\\"}),(0,s.jsxs)(\\"div\\",{className:\\"flex justify-end gap-2 pt-4 border-t\\",children:[(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>V(!1),className:\\"px-4 py-2 bg-gray-100 rounded\\",children:\\"Cancelar\\"}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",className:\\"px-4 py-2 bg-indigo-600 text-white rounded\\",children:\\"Guardar\\"})]})]})]})}),(0,s.jsx)(x.$,{address:ee.address,isOpen:L,onClose:()=>U(!1),onCoordinatesSelected:(e,t)=>{et(a=>({...a,latitude:e,longitude:t})),U(!1)}}),O&&(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 backdrop-blur-sm\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl p-6 w-full max-w-md\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-lg font-bold mb-4\\",children:H?\\"Editar Servicio\\":\\"Nuevo Servicio\\"}),(0,s.jsxs)(\\"div\\",{className:\\"bg-gradient-to-r from-slate-50 to-slate-100 p-4 rounded-xl border border-slate-200 mb-6 flex items-center justify-between\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsxs)(\\"p\\",{className:\\"text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-1 flex items-center gap-1\\",children:[(0,s.jsx)(w.A,{size:12}),\\" Estimaci\\\\xf3n\\"]}),(0,s.jsxs)(\\"p\\",{className:\\"text-2xl font-bold text-indigo-700 leading-none\\",children:[K.estimatedHours,\\" \\",(0,s.jsx)(\\"span\\",{className:\\"text-xs font-normal text-slate-500\\",children:\\"hs/mes\\"})]}),(0,s.jsxs)(\\"p\\",{className:\\"text-[10px] text-slate-400 mt-1\\",children:[\\"~\\",K.totalVacancies,\\" vacantes proyectadas\\"]})]}),(0,s.jsx)(\\"div\\",{className:`text-2xl font-bold ${K.estimatedHours>B.hours?\\"text-red-500\\":\\"text-emerald-500\\"}`,children:K.estimatedHours>B.hours?\\"⚠\\":\\"✓\\"})]}),(0,s.jsxs)(\\"form\\",{onSubmit:eg,className:\\"space-y-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-1 block\\",children:\\"Nombre\\"}),(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded\\",value:B.name,onChange:e=>W({...B,name:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-1 block\\",children:\\"Horas/Mes (Venta)\\"}),(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded\\",type:\\"number\\",value:B.hours,onChange:e=>W({...B,hours:+e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-1 block\\",children:\\"Dotaci\\\\xf3n Simult\\\\xe1nea\\"}),(0,s.jsx)(\\"input\\",{className:\\"w-full border p-2 rounded\\",type:\\"number\\",min:\\"1\\",value:B.quantity,onChange:e=>W({...B,quantity:+e.target.value}),required:!0})]})]}),(0,s.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-3 rounded border border-slate-100 grid grid-cols-2 gap-2\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-[10px] font-bold text-gray-400 uppercase block\\",children:\\"Inicio Contrato\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:\\"w-full border p-1 rounded text-sm\\",value:B.startDate,onChange:e=>W({...B,startDate:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-[10px] font-bold text-gray-400 uppercase block\\",children:\\"Fin (Opcional)\\"}),(0,s.jsx)(\\"input\\",{type:\\"date\\",className:\\"w-full border p-1 rounded text-sm\\",value:B.endDate,onChange:e=>W({...B,endDate:e.target.value})})]})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-2 block\\",children:\\"D\\\\xedas Operativos\\"}),(0,s.jsx)(\\"div\\",{className:\\"flex justify-between gap-1\\",children:[\\"Dom\\",\\"Lun\\",\\"Mar\\",\\"Mi\\\\xe9\\",\\"Jue\\",\\"Vie\\",\\"S\\\\xe1b\\"].map((e,t)=>{let a=B.days.includes(t);return(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>W(e=>({...e,days:a?e.days.filter(e=>e!==t):[...e.days,t].sort()})),className:`w-8 h-8 rounded text-xs font-bold ${a?\\"bg-indigo-600 text-white\\":\\"bg-gray-100 text-gray-400\\"}`,children:e.charAt(0)},t)})})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex justify-end gap-2 mt-6\\",children:[(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>q(!1),className:\\"px-4 py-2 bg-gray-100 rounded\\",children:\\"Cancelar\\"}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",className:\\"px-4 py-2 bg-indigo-600 text-white rounded\\",children:\\"Guardar\\"})]})]})]})}),_&&ea&&(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl p-6 w-full max-w-2xl h-[80vh] flex flex-col\\",children:[(0,s.jsxs)(\\"div\\",{className:\\"flex justify-between items-center mb-4 border-b pb-2\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"h3\\",{className:\\"text-lg font-bold\\",children:\\"Modalidades\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-xs text-gray-500\\",children:ea.name})]}),(0,s.jsx)(\\"button\\",{onClick:()=>R(!1),className:\\"text-gray-400 hover:text-gray-600\\",children:(0,s.jsx)(A.A,{size:20})})]}),(0,s.jsx)(\\"div\\",{className:\\"flex-1 overflow-y-auto mb-4 space-y-2 p-1\\",children:er.map(e=>(0,s.jsxs)(\\"div\\",{className:\\"flex items-center justify-between p-3 border rounded-lg hover:bg-slate-50\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsxs)(\\"p\\",{className:\\"font-bold text-sm\\",children:[e.name,\\" \\",(0,s.jsxs)(\\"span\\",{className:\\"text-gray-400 text-xs\\",children:[\\"(\\",e.code,\\")\\"]})]}),(0,s.jsxs)(\\"p\\",{className:\\"text-xs text-indigo-600 font-mono\\",children:[e.startTime,\\" • \\",e.durationHours,\\"hs\\"]})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex gap-2\\",children:[(0,s.jsx)(\\"button\\",{onClick:()=>{Z({id:e.id,name:e.name,code:e.code,startTime:e.startTime,durationHours:e.durationHours}),ed(!0)},className:\\"text-indigo-600 hover:bg-indigo-50 p-1 rounded\\",children:(0,s.jsx)(u.A,{size:14})}),(0,s.jsx)(\\"button\\",{onClick:()=>ej(e.id),className:\\"text-red-600 hover:bg-red-50 p-1 rounded\\",children:(0,s.jsx)(y.A,{size:14})})]})]},e.id))}),(0,s.jsxs)(\\"form\\",{onSubmit:ef,className:\\"bg-gray-50 p-4 rounded-lg border border-gray-200\\",children:[(0,s.jsx)(\\"h4\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-3\\",children:el?\\"Editar\\":\\"Nueva\\"}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 md:grid-cols-4 gap-3 mb-3\\",children:[(0,s.jsx)(\\"input\\",{placeholder:\\"Nombre\\",className:\\"border p-2 rounded text-sm\\",value:Q.name,onChange:e=>Z({...Q,name:e.target.value}),required:!0}),(0,s.jsx)(\\"input\\",{placeholder:\\"C\\\\xf3digo\\",className:\\"border p-2 rounded text-sm\\",value:Q.code,onChange:e=>Z({...Q,code:e.target.value}),required:!0}),(0,s.jsx)(\\"input\\",{type:\\"time\\",className:\\"border p-2 rounded text-sm\\",value:Q.startTime,onChange:e=>Z({...Q,startTime:e.target.value}),required:!0}),(0,s.jsx)(\\"input\\",{type:\\"number\\",placeholder:\\"Duraci\\\\xf3n\\",className:\\"border p-2 rounded text-sm\\",value:Q.durationHours,onChange:e=>Z({...Q,durationHours:+e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex justify-end gap-2\\",children:[el&&(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>{ed(!1),Z({id:\\"\\",name:\\"\\",code:\\"\\",startTime:\\"07:00\\",durationHours:12})},className:\\"text-xs text-gray-500 underline\\",children:\\"Cancelar\\"}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",className:\\"bg-slate-800 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-black\\",children:el?\\"Actualizar\\":\\"Agregar\\"})]})]})]})}),G&&(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl p-6 w-full max-w-md\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-lg font-bold mb-4\\",children:\\"Asignaci\\\\xf3n Manual\\"}),(0,s.jsxs)(\\"form\\",{onSubmit:ev,className:\\"space-y-4\\",children:[(0,s.jsxs)(\\"select\\",{className:\\"w-full border p-2 rounded\\",value:J.employeeId,onChange:e=>X({...J,employeeId:e.target.value}),required:!0,children:[(0,s.jsx)(\\"option\\",{value:\\"\\",children:\\"Seleccione Empleado\\"}),D.map(e=>(0,s.jsx)(\\"option\\",{value:e.uid,children:e.name},e.uid))]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-2\\",children:[(0,s.jsx)(\\"input\\",{type:\\"datetime-local\\",className:\\"border p-2 rounded\\",value:J.start,onChange:e=>X({...J,start:e.target.value}),required:!0}),(0,s.jsx)(\\"input\\",{type:\\"datetime-local\\",className:\\"border p-2 rounded\\",value:J.end,onChange:e=>X({...J,end:e.target.value}),required:!0})]}),(0,s.jsxs)(\\"div\\",{className:\\"flex justify-end gap-2 mt-4\\",children:[(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>$(!1),className:\\"px-4 py-2 bg-gray-100 rounded\\",children:\\"Cancelar\\"}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",className:\\"px-4 py-2 bg-green-600 text-white rounded\\",children:\\"Asignar\\"})]})]})]})})]})}):(0,s.jsx)(d.A,{title:\\"Error\\",children:\\"404 - Objetivo no encontrado\\"})},[\\"admin\\",\\"manager\\",\\"supervisor\\"])},4592:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/objective-detail/[id]\\",function(){return a(4417)}])},4893:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"pen\\",[[\\"path\\",{d:\\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\\",key:\\"1a8usu\\"}]])},5002:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"x\\",[[\\"path\\",{d:\\"M18 6 6 18\\",key:\\"1bl5f8\\"}],[\\"path\\",{d:\\"m6 6 12 12\\",key:\\"d8bk6v\\"}]])},6346:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"plus\\",[[\\"path\\",{d:\\"M5 12h14\\",key:\\"1ays0h\\"}],[\\"path\\",{d:\\"M12 5v14\\",key:\\"s699le\\"}]])},6514:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"calculator\\",[[\\"rect\\",{width:\\"16\\",height:\\"20\\",x:\\"4\\",y:\\"2\\",rx:\\"2\\",key:\\"1nb95v\\"}],[\\"line\\",{x1:\\"8\\",x2:\\"16\\",y1:\\"6\\",y2:\\"6\\",key:\\"x4nwl0\\"}],[\\"line\\",{x1:\\"16\\",x2:\\"16\\",y1:\\"14\\",y2:\\"18\\",key:\\"wjye3r\\"}],[\\"path\\",{d:\\"M16 10h.01\\",key:\\"1m94wz\\"}],[\\"path\\",{d:\\"M12 10h.01\\",key:\\"1nrarc\\"}],[\\"path\\",{d:\\"M8 10h.01\\",key:\\"19clt8\\"}],[\\"path\\",{d:\\"M12 14h.01\\",key:\\"1etili\\"}],[\\"path\\",{d:\\"M8 14h.01\\",key:\\"6423bh\\"}],[\\"path\\",{d:\\"M12 18h.01\\",key:\\"mhygvu\\"}],[\\"path\\",{d:\\"M8 18h.01\\",key:\\"lrp35t\\"}]])},7104:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"clock\\",[[\\"path\\",{d:\\"M12 6v6l4 2\\",key:\\"mmk7yg\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}]])},8753:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>N});var s=a(7876);a(4232);var r=a(8230),i=a.n(r),l=a(9099),d=a(9423),n=a(8264),o=a(5201),c=a(9065),x=a(1538),u=a(4763),m=a(4560),h=a(8423),p=a(6068),g=a(5164),b=a(4302),y=a(3657),f=a(7932),j=a(6647);function v(){let e=(0,l.useRouter)(),{clients:t,selectedClientId:a,setClient:r}=(0,j.t)(),v=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:d.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:n.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:u.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,s.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,s.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,s.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,s.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,s.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,s.jsxs)(\\"select\\",{value:a,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,s.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),t.map(e=>(0,s.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,s.jsx)(g.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,s.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,s.jsx)(i(),{href:\\"/admin/home\\",children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,s.jsx)(b.A,{size:18}),\\" Inicio\\"]})}),v.map(t=>(0,s.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,s.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:t.title}),t.items.map(t=>(0,s.jsx)(i(),{href:t.href,children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===t.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,s.jsx)(t.icon,{size:16}),\\" \\",t.label]})},t.href))]},t.title))]}),(0,s.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,s.jsxs)(\\"button\\",{onClick:()=>f.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,s.jsx)(y.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:t}){return(0,s.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,s.jsx)(v,{}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,s.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,s.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:t})}),(0,s.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,s.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9370:(e,t,a)=>{\\"use strict\\";a.d(t,{A:()=>s});let s=(0,a(7161).A)(\\"map-pin\\",[[\\"path\\",{d:\\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\\",key:\\"1r0f0z\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"10\\",r:\\"3\\",key:\\"ilqhr7\\"}]])}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=4592)),_N_E=e.O()}]);"},{"name":"objective-management-9c2bca88c6a719f3.js","path":"apps/web/out/_next/static/chunks/pages/admin/objective-management-9c2bca88c6a719f3.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[787],{858:(e,a,t)=>{\\"use strict\\";t.d(a,{g:()=>o});var s=t(7876),r=t(4232),l=t(9099),i=t(5176),n=t(7932);let o=(e,a=[\\"admin\\"])=>{let t=Array.isArray(a)?a:[a];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",t),a=>{let o=(0,l.useRouter)(),[d,c]=(0,r.useState)(!0),[m,x]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void o.replace(\\"/\\");x(e);try{let a=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${a}`),t.includes(a)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${a}\' no autorizado.`),o.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),o.replace(\\"/\\")}});return()=>e()},[o]),d)?(0,s.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,s.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,s.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,s.jsx)(e,{...a,currentUser:m})}}},3150:(e,a,t)=>{\\"use strict\\";t.r(a),t.d(a,{default:()=>j});var s=t(7876),r=t(4232),l=t(858),i=t(8753),n=t(9099),o=t(7932),d=t(6647),c=t(7685),m=t(3684),x=t(6005),u=t.n(x);let h=\\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-200\\",b=\\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none bg-gray-50 text-gray-500 cursor-not-allowed sm:text-sm transition duration-200\\",p=\\"block text-sm font-medium text-gray-700\\",g=e=>parseFloat(e.trim().replace(\\",\\",\\".\\")),f=function(){let e=(0,n.useRouter)(),{selectedClientId:a,selectedClient:t}=(0,d.t)(),[l,i]=(0,r.useState)([]),[x,f]=(0,r.useState)(!1),[j,y]=(0,r.useState)({name:\\"\\",address:\\"\\",latitude:\\"\\",longitude:\\"\\"}),[v,N]=(0,r.useState)(!1),[w,A]=(0,r.useState)(!1),C=async()=>{if(!a)return void i([]);N(!0);try{let e=(await (0,o.kU)({action:\\"GET_ALL_OBJECTIVES\\",payload:{clientId:a}})).data;i(e.data||[])}catch(e){console.error(\\"[ObjectiveManagement] Fetch Error:\\",e),c.Ay.error(\\"Error al cargar objetivos\\")}finally{N(!1)}};(0,r.useEffect)(()=>{C()},[a]);let E=e=>{let{name:a,value:t}=e.target;(\\"name\\"===a||\\"address\\"===a)&&y(e=>({...e,[a]:t}))},k=async e=>{if(e.preventDefault(),!a)return void c.Ay.error(\\"⚠️ Debe seleccionar una empresa en el men\\\\xfa lateral.\\");if(!j.name.trim()||!j.address.trim()||!j.latitude.trim()||!j.longitude.trim())return void c.Ay.error(\\"Complete todos los campos obligatorios: Nombre, Direcci\\\\xf3n y Coordenadas.\\");let s=g(j.latitude),r=g(j.longitude);if(isNaN(s)||isNaN(r))return void c.Ay.error(\\"Las coordenadas deben ser n\\\\xfameros v\\\\xe1lidos (ej: -34.60).\\");A(!0);try{let e={name:j.name.trim(),address:j.address.trim(),clientId:a,location:{latitude:s,longitude:r}};await (0,o.kU)({action:\\"CREATE_OBJECTIVE\\",payload:e}),c.Ay.success(`Objetivo \\"${j.name}\\" creado para ${t?.businessName}`),y({name:\\"\\",address:\\"\\",latitude:\\"\\",longitude:\\"\\"}),C()}catch(e){console.error(\\"[ObjectiveManagement] Create Error:\\",e),c.Ay.error(\\"Error al crear el objetivo.\\")}finally{A(!1)}};return(0,s.jsxs)(\\"div\\",{className:\\"space-y-8\\",children:[(0,s.jsx)(\\"div\\",{className:\\"bg-white shadow-lg rounded-2xl p-6 border border-gray-200\\",children:(0,s.jsxs)(\\"form\\",{onSubmit:k,noValidate:!0,className:\\"space-y-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:p,children:\\"Nombre de la Sucursal/Puesto\\"}),(0,s.jsx)(\\"input\\",{type:\\"text\\",name:\\"name\\",value:j.name,onChange:E,className:h,placeholder:\\"Ej: Casa Central\\"})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:p,children:\\"Direcci\\\\xf3n F\\\\xedsica\\"}),(0,s.jsx)(\\"input\\",{type:\\"text\\",name:\\"address\\",value:j.address,onChange:E,className:h,placeholder:\\"Av. Siempreviva 742\\"})]}),(0,s.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4\\",children:[(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:p,children:\\"Latitud\\"}),(0,s.jsx)(\\"input\\",{type:\\"number\\",name:\\"latitude\\",value:j.latitude,onChange:E,className:b,readOnly:!0,step:\\"any\\",placeholder:\\"Asignar con el bot\\\\xf3n\\"})]}),(0,s.jsxs)(\\"div\\",{children:[(0,s.jsx)(\\"label\\",{className:p,children:\\"Longitud\\"}),(0,s.jsx)(\\"input\\",{type:\\"number\\",name:\\"longitude\\",value:j.longitude,onChange:E,className:b,readOnly:!0,step:\\"any\\",placeholder:\\"Asignar con el bot\\\\xf3n\\"})]})]}),(0,s.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>f(!0),disabled:!j.address.trim(),className:`w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-600 hover:bg-green-700 focus:outline-none transition duration-200 \\n ${!j.address.trim()?\\"opacity-70 cursor-not-allowed\\":\\"\\"}`,children:\\"Buscar/Asignar Coordenadas (Paso 1)\\"}),(0,s.jsx)(\\"button\\",{type:\\"submit\\",disabled:w||!a||!j.latitude.trim(),className:`w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 focus:outline-none transition duration-200 \\n ${w||!a||!j.latitude.trim()?\\"opacity-70 cursor-not-allowed\\":\\"hover:bg-indigo-700\\"}`,children:w?\\"Guardando...\\":\\"Crear Objetivo (Paso 2)\\"})]})}),(0,s.jsx)(m.$,{address:j.address,isOpen:x,onClose:()=>f(!1),onCoordinatesSelected:(e,a)=>{y(t=>({...t,latitude:e,longitude:a})),f(!1)}}),(0,s.jsxs)(\\"div\\",{className:`${u().objectiveListCard} bg-white shadow-lg rounded-2xl overflow-hidden border border-gray-200`,children:[(0,s.jsxs)(\\"div\\",{className:\\"px-6 py-4 border-b border-gray-200 bg-gray-50 flex justify-between items-center\\",children:[(0,s.jsxs)(\\"h3\\",{className:\\"text-lg font-bold text-gray-800\\",children:[\\"Objetivos de \\",t?.businessName||\\"...\\"]}),(0,s.jsx)(\\"span\\",{className:\\"bg-gray-100 text-gray-600 py-1 px-3 rounded-full text-xs font-bold\\",children:l.length})]}),v?(0,s.jsx)(\\"div\\",{className:\\"p-6 text-center text-gray-500\\",children:\\"Cargando datos...\\"}):(0,s.jsx)(\\"div\\",{className:\\"overflow-x-auto\\",children:(0,s.jsxs)(\\"table\\",{className:\\"min-w-full divide-y divide-gray-200\\",children:[(0,s.jsx)(\\"thead\\",{className:\\"bg-gray-100\\",children:(0,s.jsx)(\\"tr\\",{children:(0,s.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase tracking-wider\\",children:\\"Nombre y Ubicaci\\\\xf3n\\"})})}),(0,s.jsx)(\\"tbody\\",{className:\\"bg-white divide-y divide-gray-200\\",children:0===l.length?(0,s.jsx)(\\"tr\\",{children:(0,s.jsx)(\\"td\\",{className:\\"px-6 py-8 text-center text-sm text-gray-500 italic\\",children:\\"No hay objetivos registrados para esta empresa.\\"})}):l.map(a=>(0,s.jsx)(\\"tr\\",{className:\\"hover:bg-gray-50 transition duration-150 cursor-pointer\\",onClick:()=>e.push(`/admin/objective-detail/${a.id}`),children:(0,s.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,s.jsxs)(\\"div\\",{className:\\"flex items-center\\",children:[(0,s.jsx)(\\"div\\",{className:\\"flex-shrink-0 h-10 w-10 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center\\",children:(0,s.jsx)(\\"span\\",{className:\\"font-bold text-lg\\",children:a.name.charAt(0).toUpperCase()})}),(0,s.jsxs)(\\"div\\",{className:\\"ml-4\\",children:[(0,s.jsx)(\\"div\\",{className:\\"text-sm font-bold text-gray-900\\",children:a.name}),(0,s.jsx)(\\"div\\",{className:\\"text-sm text-gray-500\\",children:a.address}),(0,s.jsxs)(\\"div\\",{className:\\"text-xs text-indigo-400 font-mono mt-1\\",children:[\\"(\\",a.location?.latitude?.toFixed(4)||\\"N/A\\",\\", \\",a.location?.longitude?.toFixed(4)||\\"N/A\\",\\")\\"]})]})]})})},a.id))})]})})]})]})},j=(0,l.g)(function(){return(0,s.jsx)(i.A,{title:\\"Gesti\\\\xf3n de Objetivos y Sucursales\\",children:(0,s.jsx)(f,{})})},[\\"admin\\"])},3684:(e,a,t)=>{\\"use strict\\";t.d(a,{$:()=>i});var s=t(7876),r=t(4232),l=t(7685);let i=({address:e,onCoordinatesSelected:a,onClose:t,isOpen:i})=>{let[n,o]=(0,r.useState)(!1),d=\\"AIzaSyA0Nl6OOJI8swRVQ8uzAKpPHdE2zvEscOE\\";if(!i)return null;let c=async()=>{if(!e.trim())return void l.Ay.error(\\"Ingrese una direcci\\\\xf3n v\\\\xe1lida para buscar.\\");if(!d||\\"\\"===d.trim()){l.Ay.error(\\"Error: Falta la clave de Google Maps (NEXT_PUBLIC_GOOGLE_MAPS_API_KEY).\\"),console.error(\\"GeocodingSelector: Missing Google Maps API Key.\\");return}o(!0);let s=encodeURIComponent(e),r=`https://maps.googleapis.com/maps/api/geocode/json?address=${s}&key=${d}`;try{let s=await fetch(r),i=await s.json();if(\\"OK\\"===i.status&&i.results.length>0){let{lat:s,lng:r}=i.results[0].geometry.location,n=s.toFixed(6),o=r.toFixed(6);a(n,o),l.Ay.success(`Coordenadas asignadas a: ${e}`),t()}else l.Ay.error(\\"No se encontraron coordenadas para la direcci\\\\xf3n proporcionada.\\")}catch(e){console.error(\\"Error al consultar la API de Google:\\",e),l.Ay.error(\\"Error de red al buscar coordenadas.\\")}finally{o(!1)}};return(0,s.jsx)(\\"div\\",{className:\\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\\",children:(0,s.jsxs)(\\"div\\",{className:\\"bg-white p-6 rounded-lg shadow-xl w-full max-w-md\\",children:[(0,s.jsx)(\\"h3\\",{className:\\"text-xl font-bold mb-4 text-gray-800\\",children:\\"Buscar Coordenadas\\"}),(0,s.jsxs)(\\"p\\",{className:\\"text-sm text-gray-600 mb-4\\",children:[\\"Direcci\\\\xf3n a buscar: \\",(0,s.jsx)(\\"span\\",{className:\\"font-semibold text-indigo-600\\",children:e})]}),(0,s.jsx)(\\"button\\",{onClick:c,disabled:n||!e.trim(),className:`w-full py-2 px-4 rounded-md text-white font-medium transition duration-200 ${n||!e.trim()?\\"bg-indigo-400 cursor-not-allowed\\":\\"bg-indigo-600 hover:bg-indigo-700\\"}`,children:n?\\"Buscando...\\":\\"Confirmar B\\\\xfasqueda en Mapa\\"}),(0,s.jsx)(\\"button\\",{onClick:t,className:\\"mt-3 w-full py-2 px-4 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition duration-200\\",children:\\"Cancelar\\"})]})})}},6005:e=>{e.exports={objectiveListCard:\\"ObjectiveManagement_objectiveListCard__9wtR0\\"}},6894:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/objective-management\\",function(){return t(3150)}])},8753:(e,a,t)=>{\\"use strict\\";t.d(a,{A:()=>N});var s=t(7876);t(4232);var r=t(8230),l=t.n(r),i=t(9099),n=t(9423),o=t(8264),d=t(5201),c=t(9065),m=t(1538),x=t(4763),u=t(4560),h=t(8423),b=t(6068),p=t(5164),g=t(4302),f=t(3657),j=t(7932),y=t(6647);function v(){let e=(0,i.useRouter)(),{clients:a,selectedClientId:t,setClient:r}=(0,y.t)(),v=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:m.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:x.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:u.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:b.A,label:\\"Usuarios Sistema\\"}]}];return(0,s.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,s.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,s.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,s.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,s.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,s.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,s.jsxs)(\\"select\\",{value:t,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,s.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),a.map(e=>(0,s.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,s.jsx)(p.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,s.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,s.jsx)(l(),{href:\\"/admin/home\\",children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,s.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),v.map(a=>(0,s.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,s.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:a.title}),a.items.map(a=>(0,s.jsx)(l(),{href:a.href,children:(0,s.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===a.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,s.jsx)(a.icon,{size:16}),\\" \\",a.label]})},a.href))]},a.title))]}),(0,s.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,s.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,s.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:a}){return(0,s.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,s.jsx)(v,{}),(0,s.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,s.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,s.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:a})}),(0,s.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,s.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=6894)),_N_E=e.O()}]);"},{"name":"objectives-3041285ee9b1a504.js","path":"apps/web/out/_next/static/chunks/pages/admin/objectives-3041285ee9b1a504.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[376],{2313:(e,s,t)=>{\\"use strict\\";t.r(s),t.d(s,{default:()=>i});var a=t(7876);t(4232);var l=t(8753);function i(){return(0,a.jsx)(l.A,{title:\\"Gesti\\\\xf3n de Objetivos\\",children:(0,a.jsx)(\\"div\\",{className:\\"bg-white p-10 rounded-[2.5rem] shadow-sm border border-slate-100\\",children:(0,a.jsx)(\\"p\\",{className:\\"text-slate-500\\",children:\\"M\\\\xf3dulo restaurado. Cargando datos...\\"})})})}},7752:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/objectives\\",function(){return t(2313)}])},8753:(e,s,t)=>{\\"use strict\\";t.d(s,{A:()=>w});var a=t(7876);t(4232);var l=t(8230),i=t.n(l),n=t(9099),r=t(9423),o=t(8264),d=t(5201),c=t(9065),x=t(1538),h=t(4763),m=t(4560),p=t(8423),b=t(6068),u=t(5164),f=t(4302),v=t(3657),j=t(7932),g=t(6647);function N(){let e=(0,n.useRouter)(),{clients:s,selectedClientId:t,setClient:l}=(0,g.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:r.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:h.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:p.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:b.A,label:\\"Usuarios Sistema\\"}]}];return(0,a.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,a.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,a.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,a.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,a.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,a.jsxs)(\\"select\\",{value:t,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,a.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),s.map(e=>(0,a.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,a.jsx)(u.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,a.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,a.jsx)(i(),{href:\\"/admin/home\\",children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,a.jsx)(f.A,{size:18}),\\" Inicio\\"]})}),N.map(s=>(0,a.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,a.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:s.title}),s.items.map(s=>(0,a.jsx)(i(),{href:s.href,children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===s.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,a.jsx)(s.icon,{size:16}),\\" \\",s.label]})},s.href))]},s.title))]}),(0,a.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,a.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,a.jsx)(v.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function w({children:e,title:s}){return(0,a.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,a.jsx)(N,{}),(0,a.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,a.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,a.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:s})}),(0,a.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,a.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=7752)),_N_E=e.O()}]);"},{"name":"map-510156ae87b18b3d.js","path":"apps/web/out/_next/static/chunks/pages/admin/operations/map-510156ae87b18b3d.js","area":"FRONTEND","folder":"OPERATIONS","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[665],{858:(e,t,s)=>{\\"use strict\\";s.d(t,{g:()=>o});var l=s(7876),a=s(4232),r=s(9099),i=s(5176),n=s(7932);let o=(e,t=[\\"admin\\"])=>{let s=Array.isArray(t)?t:[t];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",s),t=>{let o=(0,r.useRouter)(),[d,c]=(0,a.useState)(!0),[x,m]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void o.replace(\\"/\\");m(e);try{let t=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${t}`),s.includes(t)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${t}\' no autorizado.`),o.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),o.replace(\\"/\\")}});return()=>e()},[o]),d)?(0,l.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,l.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,l.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,l.jsx)(e,{...t,currentUser:x})}}},3144:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});let l=(0,s(7161).A)(\\"arrow-right\\",[[\\"path\\",{d:\\"M5 12h14\\",key:\\"1ays0h\\"}],[\\"path\\",{d:\\"m12 5 7 7-7 7\\",key:\\"xquz4c\\"}]])},3538:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/operations/map\\",function(){return s(3656)}])},3656:(e,t,s)=>{\\"use strict\\";s.r(t),s.d(t,{default:()=>N});var l=s(7876),a=s(4232),r=s(9099),i=s(858),n=s(8753),o=s(7932),d=s(2945),c=s(9065),x=s(5049),m=s(8423),p=s(9982),h=s(9370);let u=(0,s(7161).A)(\\"navigation\\",[[\\"polygon\\",{points:\\"3 11 22 2 13 21 11 13 3 11\\",key:\\"1ltx0t\\"}]]);var f=s(3144),g=s(6647);let b={width:\\"100%\\",height:\\"100%\\"},j={lat:-34.6037,lng:-58.3816},v={disableDefaultUI:!0,zoomControl:!0,fullscreenControl:!0,styles:[{elementType:\\"geometry\\",stylers:[{color:\\"#f5f5f5\\"}]},{elementType:\\"labels.icon\\",stylers:[{visibility:\\"off\\"}]},{elementType:\\"labels.text.fill\\",stylers:[{color:\\"#616161\\"}]},{elementType:\\"labels.text.stroke\\",stylers:[{color:\\"#f5f5f5\\"}]},{featureType:\\"road\\",elementType:\\"geometry\\",stylers:[{color:\\"#ffffff\\"}]},{featureType:\\"water\\",elementType:\\"geometry\\",stylers:[{color:\\"#c9c9c9\\"}]},{featureType:\\"water\\",elementType:\\"labels.text.fill\\",stylers:[{color:\\"#9e9e9e\\"}]}]},N=(0,i.g)(function(){let e=(0,r.useRouter)(),{selectedClientId:t,selectedClient:s}=(0,g.t)(),[i,N]=(0,a.useState)([]),[y,w]=(0,a.useState)(\\"\\"),[A,C]=(0,a.useState)(null),[k,E]=(0,a.useState)(null),[z,T]=(0,a.useState)({total:0,alerts:0,active:0}),{isLoaded:R}=(0,d.KD)({id:\\"google-map-script\\",googleMapsApiKey:\\"AIzaSyA0Nl6OOJI8swRVQ8uzAKpPHdE2zvEscOE\\"});(0,a.useEffect)(()=>{(async()=>{try{let e=((await (0,o.kU)({action:\\"GET_ALL_OBJECTIVES\\",payload:t?{clientId:t}:{}})).data.data||[]).filter(e=>e.location&&e.location.latitude).map((e,t)=>({...e,status:t%5==0?\\"alert\\":\\"ok\\",activePersonnel:Math.floor(4*Math.random())}));if(N(e),k&&e.length>0){let t=new google.maps.LatLngBounds;e.forEach(e=>t.extend({lat:e.location.latitude,lng:e.location.longitude})),k.fitBounds(t)}T({total:e.length,alerts:e.filter(e=>\\"alert\\"===e.status).length,active:e.reduce((e,t)=>e+t.activePersonnel,0)})}catch(e){console.error(\\"Error cargando mapa:\\",e)}})()},[t,k]);let O=(0,a.useMemo)(()=>i.filter(e=>e.name.toLowerCase().includes(y.toLowerCase())||e.address.toLowerCase().includes(y.toLowerCase())),[i,y]),I=(0,a.useCallback)(e=>{C(e),k&&(k.panTo({lat:e.location.latitude,lng:e.location.longitude}),k.setZoom(15))},[k]);return(0,l.jsxs)(n.A,{title:\\"Centro de Operaciones Global\\",children:[(0,l.jsxs)(\\"div\\",{className:\\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6\\",children:[(0,l.jsxs)(\\"div\\",{className:\\"bg-white p-4 rounded-xl shadow-sm border border-slate-200 flex items-center justify-between\\",children:[(0,l.jsxs)(\\"div\\",{children:[(0,l.jsx)(\\"p\\",{className:\\"text-xs text-slate-500 font-bold uppercase\\",children:\\"Objetivos Visibles\\"}),(0,l.jsx)(\\"p\\",{className:\\"text-2xl font-bold text-slate-800\\",children:z.total}),(0,l.jsx)(\\"p\\",{className:\\"text-xs text-slate-400\\",children:s?s.businessName:\\"Todas las Empresas\\"})]}),(0,l.jsx)(\\"div\\",{className:\\"p-2 bg-indigo-50 rounded-lg text-indigo-600\\",children:(0,l.jsx)(c.A,{size:24})})]}),(0,l.jsxs)(\\"div\\",{className:`p-4 rounded-xl shadow-sm border flex items-center justify-between ${z.alerts>0?\\"bg-red-50 border-red-200\\":\\"bg-white border-slate-200\\"}`,children:[(0,l.jsxs)(\\"div\\",{children:[(0,l.jsx)(\\"p\\",{className:`text-xs font-bold uppercase ${z.alerts>0?\\"text-red-600\\":\\"text-slate-500\\"}`,children:\\"Incidencias Activas\\"}),(0,l.jsx)(\\"p\\",{className:`text-2xl font-bold ${z.alerts>0?\\"text-red-700\\":\\"text-slate-800\\"}`,children:z.alerts}),(0,l.jsx)(\\"p\\",{className:\\"text-xs text-slate-400\\",children:\\"Requieren atenci\\\\xf3n\\"})]}),(0,l.jsx)(\\"div\\",{className:`p-2 rounded-lg ${z.alerts>0?\\"bg-red-100 text-red-600 animate-pulse\\":\\"bg-slate-50 text-slate-400\\"}`,children:(0,l.jsx)(x.A,{size:24})})]}),(0,l.jsxs)(\\"div\\",{className:\\"bg-white p-4 rounded-xl shadow-sm border border-slate-200 flex items-center justify-between\\",children:[(0,l.jsxs)(\\"div\\",{children:[(0,l.jsx)(\\"p\\",{className:\\"text-xs text-slate-500 font-bold uppercase\\",children:\\"Fuerza Activa\\"}),(0,l.jsx)(\\"p\\",{className:\\"text-2xl font-bold text-green-700\\",children:z.active}),(0,l.jsx)(\\"p\\",{className:\\"text-xs text-slate-400\\",children:\\"Empleados en sitio\\"})]}),(0,l.jsx)(\\"div\\",{className:\\"p-2 bg-green-50 rounded-lg text-green-600\\",children:(0,l.jsx)(m.A,{size:24})})]})]}),(0,l.jsxs)(\\"div\\",{className:\\"flex flex-col lg:flex-row h-[calc(100vh-250px)] bg-white rounded-xl shadow-lg border border-slate-200 overflow-hidden\\",children:[(0,l.jsxs)(\\"div\\",{className:\\"w-full lg:w-96 border-r border-slate-200 flex flex-col bg-white z-10 relative\\",children:[(0,l.jsx)(\\"div\\",{className:\\"p-4 border-b border-slate-100 bg-slate-50/50\\",children:(0,l.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,l.jsx)(p.A,{className:\\"absolute left-3 top-1/2 transform -translate-y-1/2 text-slate-400\\",size:16}),(0,l.jsx)(\\"input\\",{type:\\"text\\",placeholder:\\"Buscar objetivo...\\",className:\\"w-full pl-9 pr-4 py-2 bg-white border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-indigo-500 outline-none transition-all\\",value:y,onChange:e=>w(e.target.value)})]})}),(0,l.jsxs)(\\"div\\",{className:\\"flex-1 overflow-y-auto p-2 space-y-1 bg-slate-50/30\\",children:[0===O.length&&(0,l.jsx)(\\"div\\",{className:\\"p-4 text-center text-slate-400 text-sm\\",children:\\"No se encontraron resultados.\\"}),O.map(e=>(0,l.jsxs)(\\"div\\",{onClick:()=>I(e),className:`p-3 rounded-lg border cursor-pointer transition-all group ${A?.id===e.id?\\"bg-white border-indigo-500 shadow-md ring-1 ring-indigo-50\\":\\"bg-white border-slate-200 hover:border-indigo-300 hover:shadow-sm\\"}`,children:[(0,l.jsxs)(\\"div\\",{className:\\"flex justify-between items-start\\",children:[(0,l.jsxs)(\\"div\\",{children:[(0,l.jsx)(\\"p\\",{className:`font-bold text-sm ${A?.id===e.id?\\"text-indigo-700\\":\\"text-slate-700\\"}`,children:e.name}),(0,l.jsxs)(\\"p\\",{className:\\"text-xs text-slate-500 truncate w-48 flex items-center mt-0.5\\",children:[(0,l.jsx)(h.A,{size:10,className:\\"mr-1\\"}),\\" \\",e.address]})]}),(0,l.jsx)(\\"div\\",{className:`w-2.5 h-2.5 rounded-full shadow-sm ${\\"alert\\"===e.status?\\"bg-red-500 animate-pulse\\":\\"warning\\"===e.status?\\"bg-yellow-400\\":\\"bg-green-500\\"}`})]}),A?.id===e.id&&(0,l.jsx)(\\"div\\",{className:\\"mt-2 pt-2 border-t border-slate-100 flex justify-end\\",children:(0,l.jsxs)(\\"span\\",{className:\\"text-[10px] text-indigo-600 font-bold flex items-center\\",children:[\\"VER EN MAPA \\",(0,l.jsx)(u,{size:10,className:\\"ml-1\\"})]})})]},e.id))]})]}),(0,l.jsx)(\\"div\\",{className:\\"flex-1 relative bg-slate-100\\",children:R?(0,l.jsxs)(d.u6,{mapContainerStyle:b,center:j,zoom:10,onLoad:e=>E(e),options:v,children:[O.map(e=>{var t;let s;return(0,l.jsx)(d.pH,{position:{lat:e.location.latitude,lng:e.location.longitude},onClick:()=>I(e),icon:(t=e.status,s=\\"#10B981\\",\\"alert\\"===t&&(s=\\"#EF4444\\"),\\"warning\\"===t&&(s=\\"#F59E0B\\"),{path:\\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z M12 11.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\\",fillColor:s,fillOpacity:1,strokeWeight:1.5,strokeColor:\\"#FFFFFF\\",scale:1.8,anchor:{x:12,y:22}}),animation:A?.id===e.id?google.maps.Animation.BOUNCE:void 0},e.id)}),A&&(0,l.jsx)(d.Fu,{position:{lat:A.location.latitude,lng:A.location.longitude},onCloseClick:()=>C(null),options:{pixelOffset:new google.maps.Size(0,-40)},children:(0,l.jsxs)(\\"div\\",{className:\\"p-1 min-w-[240px]\\",children:[(0,l.jsxs)(\\"div\\",{className:\\"flex items-center justify-between mb-3 border-b pb-2 border-gray-100\\",children:[(0,l.jsx)(\\"h4\\",{className:\\"font-extrabold text-slate-800 text-sm\\",children:A.name}),(0,l.jsx)(\\"span\\",{className:`text-[10px] font-bold px-2 py-0.5 rounded uppercase ${\\"alert\\"===A.status?\\"bg-red-100 text-red-600\\":\\"bg-green-100 text-green-700\\"}`,children:\\"alert\\"===A.status?\\"INCIDENCIA\\":\\"OPERATIVO\\"})]}),(0,l.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-2 mb-4\\",children:[(0,l.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-2 rounded text-center\\",children:[(0,l.jsx)(\\"p\\",{className:\\"text-[10px] text-slate-400 uppercase font-bold\\",children:\\"Personal\\"}),(0,l.jsx)(\\"p\\",{className:\\"text-sm font-bold text-slate-700\\",children:A.activePersonnel})]}),(0,l.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-2 rounded text-center\\",children:[(0,l.jsx)(\\"p\\",{className:\\"text-[10px] text-slate-400 uppercase font-bold\\",children:\\"Estado\\"}),(0,l.jsx)(\\"p\\",{className:\\"text-sm font-bold text-slate-700\\",children:\\"Activo\\"})]})]}),(0,l.jsxs)(\\"button\\",{onClick:()=>{A&&e.push(`/admin/objective-detail/${A.id}`)},className:\\"w-full bg-slate-900 text-white py-2 rounded-lg text-xs font-bold hover:bg-black flex items-center justify-center gap-2 transition-all shadow-md group\\",children:[\\"ABRIR TORRE DE CONTROL\\",(0,l.jsx)(f.A,{size:12,className:\\"group-hover:translate-x-1 transition-transform\\"})]})]})})]}):(0,l.jsx)(\\"div\\",{className:\\"h-full w-full flex flex-col items-center justify-center text-slate-400\\",children:(0,l.jsx)(\\"p\\",{className:\\"animate-pulse\\",children:\\"Cargando sat\\\\xe9lite...\\"})})})]})]})},[\\"admin\\",\\"manager\\",\\"operator\\",\\"supervisor\\"])},5049:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});let l=(0,s(7161).A)(\\"triangle-alert\\",[[\\"path\\",{d:\\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\\",key:\\"wmoenq\\"}],[\\"path\\",{d:\\"M12 9v4\\",key:\\"juzpu7\\"}],[\\"path\\",{d:\\"M12 17h.01\\",key:\\"p32p05\\"}]])},8753:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>y});var l=s(7876);s(4232);var a=s(8230),r=s.n(a),i=s(9099),n=s(9423),o=s(8264),d=s(5201),c=s(9065),x=s(1538),m=s(4763),p=s(4560),h=s(8423),u=s(6068),f=s(5164),g=s(4302),b=s(3657),j=s(7932),v=s(6647);function N(){let e=(0,i.useRouter)(),{clients:t,selectedClientId:s,setClient:a}=(0,v.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:p.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:u.A,label:\\"Usuarios Sistema\\"}]}];return(0,l.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,l.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,l.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,l.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,l.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,l.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,l.jsxs)(\\"select\\",{value:s,onChange:e=>a(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,l.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),t.map(e=>(0,l.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,l.jsx)(f.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,l.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,l.jsx)(r(),{href:\\"/admin/home\\",children:(0,l.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,l.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),N.map(t=>(0,l.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,l.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:t.title}),t.items.map(t=>(0,l.jsx)(r(),{href:t.href,children:(0,l.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===t.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,l.jsx)(t.icon,{size:16}),\\" \\",t.label]})},t.href))]},t.title))]}),(0,l.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,l.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,l.jsx)(b.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function y({children:e,title:t}){return(0,l.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,l.jsx)(N,{}),(0,l.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,l.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,l.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:t})}),(0,l.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,l.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9370:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});let l=(0,s(7161).A)(\\"map-pin\\",[[\\"path\\",{d:\\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\\",key:\\"1r0f0z\\"}],[\\"circle\\",{cx:\\"12\\",cy:\\"10\\",r:\\"3\\",key:\\"ilqhr7\\"}]])},9982:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>l});let l=(0,s(7161).A)(\\"search\\",[[\\"path\\",{d:\\"m21 21-4.34-4.34\\",key:\\"14j7rj\\"}],[\\"circle\\",{cx:\\"11\\",cy:\\"11\\",r:\\"8\\",key:\\"4ej97u\\"}]])}},e=>{e.O(0,[759,212,636,593,792],()=>e(e.s=3538)),_N_E=e.O()}]);"},{"name":"gantt-9521b99e391eb0b5.js","path":"apps/web/out/_next/static/chunks/pages/admin/planning/gantt-9521b99e391eb0b5.js","area":"FRONTEND","folder":"PLANNING","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[532],{858:(e,s,t)=>{\\"use strict\\";t.d(s,{g:()=>o});var r=t(7876),a=t(4232),l=t(9099),i=t(5176),n=t(7932);let o=(e,s=[\\"admin\\"])=>{let t=Array.isArray(s)?s:[s];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",t),s=>{let o=(0,l.useRouter)(),[d,c]=(0,a.useState)(!0),[x,m]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void o.replace(\\"/\\");m(e);try{let s=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${s}`),t.includes(s)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${s}\' no autorizado.`),o.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),o.replace(\\"/\\")}});return()=>e()},[o]),d)?(0,r.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,r.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,r.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,r.jsx)(e,{...s,currentUser:x})}}},2844:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/planning/gantt\\",function(){return t(3979)}])},3979:(e,s,t)=>{\\"use strict\\";t.r(s),t.d(s,{default:()=>z});var r=t(7876),a=t(4232),l=t(858),i=t(8753),n=t(289),o=t(2680),d=t(7901),c=t(3921),x=t(397),m=t(2423),h=t(4460),b=t(5079),g=t(5201),u=t(6945),p=t(6850),f=t(8640),j=t(4927),v=t(6028),N=t(9982),y=t(7104),w=t(5002),A=t(4799),k=t(485),C=t(7932),E=t(6647);function T(){let{selectedClientId:e}=(0,E.t)(),[s,t]=(0,a.useState)(new Date),[l,i]=(0,a.useState)([]),[T,z]=(0,a.useState)([]),[D,G]=(0,a.useState)(!1),[S,P]=(0,a.useState)(\\"\\"),[I,_]=(0,a.useState)(180),[$,H]=(0,a.useState)(null),M=e=>e?e.toDate&&\\"function\\"==typeof e.toDate?e.toDate():new Date(e.seconds?1e3*e.seconds:e):new Date,O=(0,a.useCallback)(async()=>{G(!0);try{let t=(await (0,C.kU)({action:\\"GET_ALL_OBJECTIVES\\",payload:e?{clientId:e}:{}})).data.data;if(i(t||[]),t&&t.length>0){let e=(0,n.o)(s),r=(0,o.f)(e,14),a=t.slice(0,15).map(e=>e.id);if(a.length>0){let s=(0,k.rJ)(C.db,\\"turnos\\"),t=(0,k.P)(s,(0,k._M)(\\"objectiveId\\",\\"in\\",a),(0,k._M)(\\"startTime\\",\\">=\\",k.Dc.fromDate(e)),(0,k._M)(\\"startTime\\",\\"<=\\",k.Dc.fromDate(r))),l=(await (0,k.GG)(t)).docs.map(e=>({id:e.id,...e.data()}));z(l)}}else z([])}catch(e){console.error(\\"Error cargando Gantt:\\",e)}finally{G(!1)}},[e,s]);(0,a.useEffect)(()=>{O()},[O]);let R=function(e,s){let{start:t,end:r}=function(e,s){let[t,r]=(0,d.x)(e,s.start,s.end);return{start:t,end:r}}(void 0,e),a=+t>+r,l=a?+t:+r,i=a?r:t;i.setHours(0,0,0,0);let n=(void 0)??1;if(!n)return[];n<0&&(n=-n,a=!a);let o=[];for(;+i<=l;)o.push((0,c.w)(t,i)),i.setDate(i.getDate()+n),i.setHours(0,0,0,0);return a?o.reverse():o}({start:(0,n.o)(s),end:(0,o.f)((0,n.o)(s),13)}),U=l.filter(e=>e.name.toLowerCase().includes(S.toLowerCase()));return(0,r.jsxs)(\\"div\\",{className:\\"flex flex-col h-[calc(100vh-140px)] bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden relative\\",children:[(0,r.jsxs)(\\"div\\",{className:\\"flex justify-between items-center p-4 border-b border-gray-200 bg-gray-50\\",children:[(0,r.jsxs)(\\"div\\",{className:\\"flex items-center gap-4\\",children:[(0,r.jsxs)(\\"h2\\",{className:\\"text-lg font-bold text-gray-700 flex items-center gap-2\\",children:[(0,r.jsx)(g.A,{className:\\"text-indigo-600\\",size:20}),\\"Cronograma Lineal\\"]}),(0,r.jsxs)(\\"div\\",{className:\\"flex bg-white rounded-lg border border-gray-300 p-1 shadow-sm items-center\\",children:[(0,r.jsx)(\\"button\\",{onClick:()=>t((0,o.f)(s,-7)),className:\\"p-1.5 hover:bg-gray-100 rounded text-gray-600\\",children:(0,r.jsx)(u.A,{size:18})}),(0,r.jsxs)(\\"span\\",{className:\\"px-4 text-sm font-bold flex items-center text-gray-700 min-w-[140px] justify-center\\",children:[(0,m.GP)(s,\\"d MMM\\",{locale:b.es}),\\" - \\",(0,m.GP)((0,o.f)(s,13),\\"d MMM\\",{locale:b.es})]}),(0,r.jsx)(\\"button\\",{onClick:()=>t((0,o.f)(s,7)),className:\\"p-1.5 hover:bg-gray-100 rounded text-gray-600\\",children:(0,r.jsx)(p.A,{size:18})})]}),(0,r.jsxs)(\\"div\\",{className:\\"flex bg-white rounded-lg border border-gray-300 p-1 shadow-sm items-center ml-2\\",children:[(0,r.jsx)(\\"button\\",{onClick:()=>_(e=>Math.max(e-50,60)),className:\\"p-1.5 hover:bg-gray-100 rounded text-gray-600\\",title:\\"Alejar\\",children:(0,r.jsx)(f.A,{size:16})}),(0,r.jsx)(\\"span\\",{className:\\"text-xs font-mono px-2 text-gray-400\\",children:\\"Zoom\\"}),(0,r.jsx)(\\"button\\",{onClick:()=>_(e=>Math.min(e+50,600)),className:\\"p-1.5 hover:bg-gray-100 rounded text-gray-600\\",title:\\"Acercar\\",children:(0,r.jsx)(j.A,{size:16})})]})]}),(0,r.jsxs)(\\"div\\",{className:\\"flex items-center gap-3\\",children:[D&&(0,r.jsxs)(\\"span\\",{className:\\"text-xs text-indigo-500 flex items-center animate-pulse\\",children:[(0,r.jsx)(v.A,{size:14,className:\\"mr-1 animate-spin\\"}),\\" Cargando...\\"]}),(0,r.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,r.jsx)(N.A,{className:\\"absolute left-3 top-2 text-gray-400\\",size:16}),(0,r.jsx)(\\"input\\",{type:\\"text\\",placeholder:\\"Buscar sede...\\",className:\\"pl-9 pr-4 py-1.5 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 outline-none w-64\\",value:S,onChange:e=>P(e.target.value)})]})]})]}),(0,r.jsxs)(\\"div\\",{className:\\"flex flex-1 overflow-hidden relative\\",children:[(0,r.jsxs)(\\"div\\",{className:\\"w-64 flex-shrink-0 border-r border-gray-200 bg-white z-20 shadow-md flex flex-col h-full\\",children:[(0,r.jsx)(\\"div\\",{className:\\"h-10 border-b border-gray-200 bg-gray-100/50 flex items-center px-4 text-[10px] font-bold text-gray-500 uppercase tracking-wider\\",children:\\"Sede / Objetivo\\"}),(0,r.jsx)(\\"div\\",{className:\\"overflow-hidden bg-white\\",children:U.map(e=>(0,r.jsx)(\\"div\\",{className:\\"h-16 border-b border-gray-100 flex items-center px-4 hover:bg-gray-50 transition-colors group\\",children:(0,r.jsxs)(\\"div\\",{className:\\"flex items-center gap-3 w-full\\",children:[(0,r.jsx)(\\"div\\",{className:\\"w-8 h-8 rounded-lg bg-slate-100 text-slate-600 flex items-center justify-center font-bold text-xs group-hover:bg-indigo-100 group-hover:text-indigo-600 transition-colors\\",children:e.name.charAt(0)}),(0,r.jsxs)(\\"div\\",{className:\\"min-w-0\\",children:[(0,r.jsx)(\\"p\\",{className:\\"text-sm font-bold text-gray-700 truncate\\",children:e.name}),(0,r.jsx)(\\"p\\",{className:\\"text-[10px] text-gray-400 truncate\\",children:e.address})]})]})},e.id))})]}),(0,r.jsx)(\\"div\\",{className:\\"flex-1 overflow-auto bg-slate-50 relative\\",children:(0,r.jsxs)(\\"div\\",{className:\\"min-w-max\\",children:[(0,r.jsx)(\\"div\\",{className:\\"flex border-b border-gray-200 sticky top-0 z-10 bg-white/95 backdrop-blur shadow-sm h-10\\",children:R.map(e=>{let s=(0,h.r)(e,new Date);return(0,r.jsx)(\\"div\\",{className:`flex-shrink-0 border-r border-gray-100 flex flex-col justify-center items-center ${s?\\"bg-indigo-50/50\\":\\"\\"}`,style:{width:I},children:(0,r.jsxs)(\\"div\\",{className:\\"flex gap-1 items-baseline\\",children:[(0,r.jsx)(\\"span\\",{className:`text-[10px] font-bold uppercase ${s?\\"text-indigo-600\\":\\"text-gray-400\\"}`,children:(0,m.GP)(e,\\"EEE\\",{locale:b.es})}),(0,r.jsx)(\\"span\\",{className:`text-xs font-bold leading-none ${s?\\"text-indigo-700\\":\\"text-gray-700\\"}`,children:(0,m.GP)(e,\\"d\\")})]})},e.toISOString())})}),(0,r.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,r.jsx)(\\"div\\",{className:\\"absolute inset-0 flex pointer-events-none h-full\\",children:R.map(e=>(0,r.jsx)(\\"div\\",{className:\\"border-r border-gray-300 h-full relative\\",style:{width:I},children:I>150&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(\\"div\\",{className:\\"absolute left-[25%] top-0 bottom-0 border-r border-gray-100 border-dashed w-0\\"}),(0,r.jsx)(\\"div\\",{className:\\"absolute left-[50%] top-0 bottom-0 border-r border-gray-100 border-dashed w-0\\"}),(0,r.jsx)(\\"div\\",{className:\\"absolute left-[75%] top-0 bottom-0 border-r border-gray-100 border-dashed w-0\\"})]})},e.toISOString()))}),U.map(e=>{let t=T.filter(s=>s.objectiveId===e.id);return(0,r.jsx)(\\"div\\",{className:\\"h-16 border-b border-gray-200/50 relative hover:bg-white/50 transition-colors\\",children:t.map(e=>{let t=(e=>{let t=M(e.startTime),r=M(e.endTime),a=(0,n.o)(s);if(isNaN(t.getTime())||isNaN(r.getTime()))return null;let l=(0,x.o)(t,a),i=(0,x.o)(r,t),o=I/1440,d=l*o,c=i*o;return d+c<0?null:{left:`${d}px`,width:`${Math.max(c,4)}px`}})(e);if(!t)return null;let a=\\"VACANTE\\"===e.employeeId,l=M(e.startTime),i=M(e.endTime);return(0,r.jsxs)(\\"div\\",{onClick:()=>H(e),className:`absolute top-3 h-10 rounded-md shadow-sm border text-[10px] flex flex-col justify-center px-2 cursor-pointer transition-all hover:brightness-110 hover:shadow-md hover:scale-[1.01] hover:z-30 overflow-hidden whitespace-nowrap\\n ${a?\\"bg-gray-100 border-gray-300 text-gray-400 border-dashed\\":e.isOvertime?\\"bg-amber-500 border-amber-600 text-white\\":\\"bg-indigo-600 border-indigo-700 text-white\\"}\\n `,style:t,title:`${e.employeeName} (${(0,m.GP)(l,\\"HH:mm\\")} - ${(0,m.GP)(i,\\"HH:mm\\")})`,children:[(0,r.jsx)(\\"span\\",{className:\\"font-bold truncate\\",children:a?\\"VACANTE\\":e.employeeName}),I>80&&(0,r.jsxs)(\\"span\\",{className:\\"opacity-90 text-[9px] font-mono\\",children:[(0,m.GP)(l,\\"HH:mm\\"),\\" - \\",(0,m.GP)(i,\\"HH:mm\\")]})]},e.id)})},e.id)})]})]})})]}),$&&(0,r.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 backdrop-blur-sm animate-in fade-in duration-200\\",children:(0,r.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-2xl w-full max-w-sm overflow-hidden transform transition-all scale-100\\",children:[(0,r.jsxs)(\\"div\\",{className:\\"bg-gray-50 px-5 py-4 border-b border-gray-100 flex justify-between items-center\\",children:[(0,r.jsxs)(\\"h3\\",{className:\\"font-bold text-gray-800 flex items-center gap-2\\",children:[(0,r.jsx)(y.A,{size:16,className:\\"text-indigo-600\\"}),\\" Detalle de Turno\\"]}),(0,r.jsx)(\\"button\\",{onClick:()=>H(null),className:\\"text-gray-400 hover:text-gray-600 transition-colors\\",children:(0,r.jsx)(w.A,{size:20})})]}),(0,r.jsxs)(\\"div\\",{className:\\"p-6 space-y-4\\",children:[(0,r.jsxs)(\\"div\\",{children:[(0,r.jsx)(\\"label\\",{className:\\"text-[10px] font-bold text-gray-400 uppercase tracking-wider mb-1 block\\",children:\\"Colaborador\\"}),(0,r.jsxs)(\\"div\\",{className:\\"flex items-center gap-3\\",children:[(0,r.jsx)(\\"div\\",{className:`w-10 h-10 rounded-full flex items-center justify-center font-bold text-sm ${\\"VACANTE\\"===$.employeeId?\\"bg-gray-100 text-gray-400\\":\\"bg-indigo-100 text-indigo-700\\"}`,children:\\"VACANTE\\"===$.employeeName?\\"V\\":$.employeeName.charAt(0)}),(0,r.jsxs)(\\"div\\",{children:[(0,r.jsx)(\\"p\\",{className:\\"font-bold text-gray-800 text-sm\\",children:$.employeeName}),(0,r.jsx)(\\"p\\",{className:\\"text-xs text-gray-500\\",children:\\"VACANTE\\"===$.employeeId?\\"Posici\\\\xf3n vacante\\":\\"Asignado\\"})]})]})]}),(0,r.jsxs)(\\"div\\",{className:\\"grid grid-cols-2 gap-4 pt-2\\",children:[(0,r.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-3 rounded-lg border border-slate-100\\",children:[(0,r.jsx)(\\"label\\",{className:\\"text-[10px] font-bold text-gray-400 uppercase block mb-1\\",children:\\"Horario\\"}),(0,r.jsxs)(\\"p\\",{className:\\"font-mono text-sm text-indigo-700 font-bold\\",children:[(0,m.GP)(M($.startTime),\\"HH:mm\\"),\\" - \\",(0,m.GP)(M($.endTime),\\"HH:mm\\")]}),(0,r.jsxs)(\\"p\\",{className:\\"text-[10px] text-gray-400 mt-1\\",children:[(0,x.o)(M($.endTime),M($.startTime))/60,\\" horas\\"]})]}),(0,r.jsxs)(\\"div\\",{className:\\"bg-slate-50 p-3 rounded-lg border border-slate-100\\",children:[(0,r.jsx)(\\"label\\",{className:\\"text-[10px] font-bold text-gray-400 uppercase block mb-1\\",children:\\"Objetivo\\"}),(0,r.jsx)(\\"p\\",{className:\\"text-xs font-bold text-gray-700 line-clamp-2\\",children:$.objectiveName})]})]}),(0,r.jsx)(\\"div\\",{className:\\"pt-2\\",children:(0,r.jsxs)(\\"div\\",{className:`flex items-center gap-2 p-2 rounded-lg text-xs font-bold ${\\"Completed\\"===$.status?\\"bg-green-50 text-green-700 border border-green-100\\":\\"InProgress\\"===$.status?\\"bg-blue-50 text-blue-700 border border-blue-100 animate-pulse\\":\\"bg-gray-50 text-gray-500 border border-gray-200\\"}`,children:[(0,r.jsx)(A.A,{size:14}),\\"Estado: \\",\\"Assigned\\"===$.status?\\"Programado\\":$.status]})})]}),(0,r.jsx)(\\"div\\",{className:\\"bg-gray-50 px-5 py-3 flex justify-end\\",children:(0,r.jsx)(\\"button\\",{onClick:()=>H(null),className:\\"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50 transition-colors shadow-sm\\",children:\\"Cerrar\\"})})]})})]})}let z=(0,l.g)(function(){return(0,r.jsx)(i.A,{title:\\"Planificaci\\\\xf3n de Recursos (Gantt)\\",children:(0,r.jsx)(\\"div\\",{className:\\"p-4 h-full\\",children:(0,r.jsx)(T,{})})})},[\\"admin\\",\\"scheduler\\",\\"manager\\"])},4799:(e,s,t)=>{\\"use strict\\";t.d(s,{A:()=>r});let r=(0,t(7161).A)(\\"circle-check\\",[[\\"circle\\",{cx:\\"12\\",cy:\\"12\\",r:\\"10\\",key:\\"1mglay\\"}],[\\"path\\",{d:\\"m9 12 2 2 4-4\\",key:\\"dzmm74\\"}]])},6028:(e,s,t)=>{\\"use strict\\";t.d(s,{A:()=>r});let r=(0,t(7161).A)(\\"loader-circle\\",[[\\"path\\",{d:\\"M21 12a9 9 0 1 1-6.219-8.56\\",key:\\"13zald\\"}]])},8753:(e,s,t)=>{\\"use strict\\";t.d(s,{A:()=>y});var r=t(7876);t(4232);var a=t(8230),l=t.n(a),i=t(9099),n=t(9423),o=t(8264),d=t(5201),c=t(9065),x=t(1538),m=t(4763),h=t(4560),b=t(8423),g=t(6068),u=t(5164),p=t(4302),f=t(3657),j=t(7932),v=t(6647);function N(){let e=(0,i.useRouter)(),{clients:s,selectedClientId:t,setClient:a}=(0,v.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:h.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:b.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:g.A,label:\\"Usuarios Sistema\\"}]}];return(0,r.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,r.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,r.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,r.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,r.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,r.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,r.jsxs)(\\"select\\",{value:t,onChange:e=>a(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,r.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),s.map(e=>(0,r.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,r.jsx)(u.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,r.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,r.jsx)(l(),{href:\\"/admin/home\\",children:(0,r.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,r.jsx)(p.A,{size:18}),\\" Inicio\\"]})}),N.map(s=>(0,r.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,r.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:s.title}),s.items.map(s=>(0,r.jsx)(l(),{href:s.href,children:(0,r.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===s.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,r.jsx)(s.icon,{size:16}),\\" \\",s.label]})},s.href))]},s.title))]}),(0,r.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,r.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,r.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function y({children:e,title:s}){return(0,r.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,r.jsx)(N,{}),(0,r.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,r.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,r.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:s})}),(0,r.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,r.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,858,636,593,792],()=>e(e.s=2844)),_N_E=e.O()}]);"},{"name":"matrix-c650b44ab7c61c72.js","path":"apps/web/out/_next/static/chunks/pages/admin/planning/matrix-c650b44ab7c61c72.js","area":"FRONTEND","folder":"PLANNING","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[909],{2399:(e,t,s)=>{\\"use strict\\";s.r(t),s.d(t,{default:()=>u});var a=s(7876),l=s(4232),r=s(8753),i=s(6647),n=s(7914),d=s(7932),o=s(6945),c=s(8264),x=s(6850),h=s(7161);let m=(0,h.A)(\\"funnel\\",[[\\"path\\",{d:\\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\\",key:\\"sc7q7i\\"}]]);var p=s(6028);let b=(0,h.A)(\\"user-plus\\",[[\\"path\\",{d:\\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\\",key:\\"1yyitq\\"}],[\\"circle\\",{cx:\\"9\\",cy:\\"7\\",r:\\"4\\",key:\\"nufk8\\"}],[\\"line\\",{x1:\\"19\\",x2:\\"19\\",y1:\\"8\\",y2:\\"14\\",key:\\"1bvyxn\\"}],[\\"line\\",{x1:\\"22\\",x2:\\"16\\",y1:\\"11\\",y2:\\"11\\",key:\\"1shjgl\\"}]]);function u(){let e,t,s,{selectedClientId:h}=(0,i.t)(),[u,f]=(0,l.useState)(new Date),{data:j=[],isLoading:v}=(0,n.I)({queryKey:[\\"services\\",h],queryFn:async()=>{let e=await (0,d.Jo)({action:\\"GET_SERVICES\\",payload:{clientId:h}});return e?.data||[]},enabled:!!h}),N=(t=(e=new Date(u)).getDay(),s=e.getDate()-t+(0===t?-6:1),e.setDate(s),Array.from({length:7},(t,s)=>{let a=new Date(e);return a.setDate(e.getDate()+s),a}));return(0,a.jsx)(r.A,{title:\\"Matriz de Planificaci\\\\xf3n\\",children:(0,a.jsxs)(\\"div\\",{className:\\"bg-white rounded-[2.5rem] shadow-sm border border-slate-100 overflow-hidden\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"p-6 border-b border-slate-50 flex flex-col md:flex-row md:items-center justify-between gap-4\\",children:[(0,a.jsx)(\\"div\\",{className:\\"flex items-center gap-4\\",children:(0,a.jsxs)(\\"div\\",{className:\\"flex bg-slate-100 rounded-xl p-1 shadow-inner\\",children:[(0,a.jsx)(\\"button\\",{onClick:()=>{let e=new Date(u);e.setDate(e.getDate()-7),f(e)},className:\\"p-2 hover:bg-white hover:shadow-sm rounded-lg transition-all\\",children:(0,a.jsx)(o.A,{size:18})}),(0,a.jsxs)(\\"div\\",{className:\\"px-6 py-2 flex items-center gap-2 text-[11px] font-black uppercase tracking-tighter text-slate-600\\",children:[(0,a.jsx)(c.A,{size:14,className:\\"text-indigo-500\\"}),N[0].toLocaleDateString(\\"es-ES\\",{month:\\"short\\"}).toUpperCase(),\\" \\",N[0].getDate(),\\" - \\",N[6].getDate()]}),(0,a.jsx)(\\"button\\",{onClick:()=>{let e=new Date(u);e.setDate(e.getDate()+7),f(e)},className:\\"p-2 hover:bg-white hover:shadow-sm rounded-lg transition-all\\",children:(0,a.jsx)(x.A,{size:18})})]})}),(0,a.jsx)(\\"div\\",{className:\\"flex items-center gap-2\\",children:(0,a.jsxs)(\\"button\\",{className:\\"flex items-center gap-2 px-6 py-2.5 bg-slate-900 text-white rounded-xl text-xs font-bold hover:bg-slate-800 transition-all shadow-lg shadow-slate-900/20\\",children:[(0,a.jsx)(m,{size:14}),\\" Filtros Avanzados\\"]})})]}),(0,a.jsx)(\\"div\\",{className:\\"overflow-x-auto\\",children:(0,a.jsxs)(\\"table\\",{className:\\"w-full border-collapse\\",children:[(0,a.jsx)(\\"thead\\",{children:(0,a.jsxs)(\\"tr\\",{className:\\"bg-slate-50/50\\",children:[(0,a.jsx)(\\"th\\",{className:\\"sticky left-0 z-20 bg-slate-50 px-8 py-6 border-b border-r border-slate-100 min-w-[300px] text-left text-[10px] font-black text-slate-400 uppercase tracking-[0.2em]\\",children:\\"Objetivo / Puesto de Servicio\\"}),N.map((e,t)=>(0,a.jsxs)(\\"th\\",{className:\\"px-4 py-6 border-b border-slate-100 min-w-[150px] text-center border-r border-slate-50\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1\\",children:e.toLocaleDateString(\\"es-ES\\",{weekday:\\"short\\"})}),(0,a.jsx)(\\"p\\",{className:`text-lg font-black ${e.toDateString()===new Date().toDateString()?\\"text-indigo-600\\":\\"text-slate-800\\"}`,children:e.getDate()})]},t))]})}),(0,a.jsx)(\\"tbody\\",{className:\\"divide-y divide-slate-100\\",children:v?(0,a.jsx)(\\"tr\\",{children:(0,a.jsx)(\\"td\\",{colSpan:8,className:\\"py-20 text-center\\",children:(0,a.jsxs)(\\"div\\",{className:\\"flex flex-col items-center gap-4\\",children:[(0,a.jsx)(p.A,{className:\\"animate-spin text-indigo-500\\",size:32}),(0,a.jsx)(\\"p\\",{className:\\"text-sm font-bold text-slate-400 uppercase tracking-widest\\",children:\\"Sincronizando con Firebase...\\"})]})})}):0===j.length?(0,a.jsx)(\\"tr\\",{children:(0,a.jsx)(\\"td\\",{colSpan:8,className:\\"py-20 text-center\\",children:(0,a.jsxs)(\\"div\\",{className:\\"max-w-xs mx-auto space-y-4\\",children:[(0,a.jsx)(\\"div\\",{className:\\"w-16 h-16 bg-slate-50 rounded-3xl flex items-center justify-center mx-auto\\",children:(0,a.jsx)(g,{className:\\"text-slate-200\\",size:32})}),(0,a.jsx)(\\"p\\",{className:\\"text-sm font-medium text-slate-500 italic\\",children:h?\\"No hay servicios configurados para esta empresa.\\":\\"Por favor, selecciona una empresa para ver la matriz.\\"})]})})}):j.map(e=>(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(\\"tr\\",{className:\\"bg-slate-50/80\\",children:(0,a.jsx)(\\"td\\",{colSpan:8,className:\\"sticky left-0 px-8 py-3 text-[10px] font-black text-indigo-600 uppercase tracking-[0.2em] border-b border-slate-100\\",children:e.name})}),(e.puestos||[\\"Puesto General\\"]).map((t,s)=>(0,a.jsxs)(\\"tr\\",{className:\\"group hover:bg-slate-50/50 transition-colors\\",children:[(0,a.jsxs)(\\"td\\",{className:\\"sticky left-0 z-10 bg-white group-hover:bg-slate-50/50 px-8 py-6 border-b border-r border-slate-100\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-sm font-bold text-slate-700\\",children:t}),(0,a.jsxs)(\\"p\\",{className:\\"text-[10px] text-slate-400 font-medium mt-1\\",children:[\\"ID: \\",e.id.substring(0,8)]})]}),N.map((e,t)=>(0,a.jsx)(\\"td\\",{className:\\"p-3 border-b border-r border-slate-50\\",children:(0,a.jsx)(\\"div\\",{className:\\"h-16 w-full border-2 border-dashed border-slate-100 rounded-2xl flex items-center justify-center hover:border-indigo-200 hover:bg-indigo-50/50 transition-all cursor-pointer group/cell\\",children:(0,a.jsx)(b,{size:18,className:\\"text-slate-200 group-hover/cell:text-indigo-400 transition-colors\\"})})},t))]},s))]},e.id))})]})})]})})}function g({size:e,className:t}){return(0,a.jsxs)(\\"svg\\",{width:e,height:e,viewBox:\\"0 0 24 24\\",fill:\\"none\\",stroke:\\"currentColor\\",strokeWidth:\\"2\\",strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",className:t,children:[(0,a.jsx)(\\"path\\",{d:\\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\\"}),(0,a.jsx)(\\"path\\",{d:\\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\\"}),(0,a.jsx)(\\"path\\",{d:\\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2\\"}),(0,a.jsx)(\\"path\\",{d:\\"M10 6h4\\"}),(0,a.jsx)(\\"path\\",{d:\\"M10 10h4\\"}),(0,a.jsx)(\\"path\\",{d:\\"M10 14h4\\"}),(0,a.jsx)(\\"path\\",{d:\\"M10 18h4\\"})]})}},5052:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/planning/matrix\\",function(){return s(2399)}])},6028:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>a});let a=(0,s(7161).A)(\\"loader-circle\\",[[\\"path\\",{d:\\"M21 12a9 9 0 1 1-6.219-8.56\\",key:\\"13zald\\"}]])},6850:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>a});let a=(0,s(7161).A)(\\"chevron-right\\",[[\\"path\\",{d:\\"m9 18 6-6-6-6\\",key:\\"mthhwq\\"}]])},6945:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>a});let a=(0,s(7161).A)(\\"chevron-left\\",[[\\"path\\",{d:\\"m15 18-6-6 6-6\\",key:\\"1wnfg3\\"}]])},8753:(e,t,s)=>{\\"use strict\\";s.d(t,{A:()=>w});var a=s(7876);s(4232);var l=s(8230),r=s.n(l),i=s(9099),n=s(9423),d=s(8264),o=s(5201),c=s(9065),x=s(1538),h=s(4763),m=s(4560),p=s(8423),b=s(6068),u=s(5164),g=s(4302),f=s(3657),j=s(7932),v=s(6647);function N(){let e=(0,i.useRouter)(),{clients:t,selectedClientId:s,setClient:l}=(0,v.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:d.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:h.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:m.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:p.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:b.A,label:\\"Usuarios Sistema\\"}]}];return(0,a.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,a.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,a.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,a.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,a.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,a.jsxs)(\\"select\\",{value:s,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,a.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),t.map(e=>(0,a.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,a.jsx)(u.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,a.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,a.jsx)(r(),{href:\\"/admin/home\\",children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,a.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),N.map(t=>(0,a.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,a.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:t.title}),t.items.map(t=>(0,a.jsx)(r(),{href:t.href,children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===t.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,a.jsx)(t.icon,{size:16}),\\" \\",t.label]})},t.href))]},t.title))]}),(0,a.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,a.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,a.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function w({children:e,title:t}){return(0,a.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,a.jsx)(N,{}),(0,a.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,a.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,a.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:t})}),(0,a.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,a.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,914,636,593,792],()=>e(e.s=5052)),_N_E=e.O()}]);"},{"name":"novedades-e18eba8670348a32.js","path":"apps/web/out/_next/static/chunks/pages/admin/rrhh/novedades-e18eba8670348a32.js","area":"FRONTEND","folder":"RRHH","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[688],{858:(e,a,s)=>{\\"use strict\\";s.d(a,{g:()=>o});var t=s(7876),r=s(4232),l=s(9099),i=s(5176),n=s(7932);let o=(e,a=[\\"admin\\"])=>{let s=Array.isArray(a)?a:[a];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",s),a=>{let o=(0,l.useRouter)(),[d,c]=(0,r.useState)(!0),[m,x]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void o.replace(\\"/\\");x(e);try{let a=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${a}`),s.includes(a)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${a}\' no autorizado.`),o.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),o.replace(\\"/\\")}});return()=>e()},[o]),d)?(0,t.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,t.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,t.jsx)(e,{...a,currentUser:m})}}},1961:(e,a,s)=>{\\"use strict\\";s.r(a),s.d(a,{default:()=>p});var t=s(7876),r=s(4232),l=s(858),i=s(8753),n=s(7685),o=s(6647),d=s(7932),c=s(4104),m=s(6372),x=s(9120);let u=[{value:\\"VACATION\\",label:\\"Vacaciones\\"},{value:\\"SICK_LEAVE\\",label:\\"Licencia M\\\\xe9dica\\"},{value:\\"OTHER\\",label:\\"Otro / Personal\\"}];function h(){let{selectedClientId:e,selectedClient:a}=(0,o.t)(),[s,l]=(0,r.useState)([]),[i,h]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),[b,f]=(0,r.useState)({employeeId:\\"\\",employeeName:\\"\\",clientId:e||\\"\\",type:\\"VACATION\\",startDate:new Date,endDate:new Date,reason:\\"\\"});(0,r.useEffect)(()=>{f(a=>({...a,clientId:e||\\"\\",employeeId:\\"\\",employeeName:\\"\\"}))},[e]),(0,r.useEffect)(()=>{(async()=>{if(!e)return l([]);h(!0);try{let a=await (0,d.r6)({action:\\"GET_ALL_EMPLOYEES\\",payload:{clientId:e}});l(a.data.data||[])}catch(e){console.error(\\"Error fetching employees:\\",e),n.Ay.error(\\"No se pudo cargar la lista de empleados.\\")}finally{h(!1)}})()},[e]);let v=(e,a)=>{let s=new Date(a+\\"T12:00:00\\");f(a=>({...a,[e]:s}))},y=async e=>{if(e.preventDefault(),!(b.employeeId&&b.clientId&&b.type?b.startDate.getTime()>b.endDate.getTime()?(n.Ay.error(\\"La fecha de inicio no puede ser posterior a la de fin.\\"),!1):!!b.reason.trim()||(n.Ay.error(\\"Debe proporcionar una raz\\\\xf3n o comentario.\\"),!1):(n.Ay.error(\\"Complete los campos obligatorios (Empleado, Tipo).\\"),!1)))return;g(!0);let a=n.Ay.loading(`Registrando ${b.type}...`);try{let e=await (0,d.createAbsence)({action:\\"CREATE_ABSENCE\\",payload:b});e.impactedShiftsCount&&e.impactedShiftsCount>0?n.Ay.success(`Novedad registrada.\\n⚠️ Se liberaron ${e.impactedShiftsCount} turnos que ahora son VACANTES.`,{id:a,duration:6e3,icon:\\"⚠️\\"}):n.Ay.success(\\"Novedad registrada exitosamente.\\",{id:a}),f(e=>({...e,type:\\"VACATION\\",startDate:new Date,endDate:new Date,reason:\\"\\"}))}catch(s){console.error(\\"Absence creation failed:\\",s);let e=s.message.includes(\\"Conflicto\\")||s.message.includes(\\"BLOQUEO\\")?s.message:\\"Error al registrar la novedad. Intente nuevamente.\\";n.Ay.error(e,{id:a,duration:5e3})}finally{g(!1)}};return e?(0,t.jsxs)(\\"div\\",{className:\\"max-w-4xl mx-auto\\",children:[(0,t.jsx)(\\"div\\",{className:\\"mb-6 flex items-center justify-between\\",children:(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h2\\",{className:\\"text-2xl font-bold text-slate-800\\",children:\\"Gesti\\\\xf3n de Novedades\\"}),(0,t.jsxs)(\\"p\\",{className:\\"text-slate-500\\",children:[\\"Registrar licencias y vacaciones para \\",(0,t.jsx)(\\"span\\",{className:\\"font-semibold text-indigo-600\\",children:a?.businessName}),\\".\\"]})]})}),(0,t.jsx)(\\"div\\",{className:\\"bg-white p-8 rounded-xl shadow-lg border border-slate-200\\",children:(0,t.jsxs)(\\"form\\",{onSubmit:y,className:\\"space-y-6\\",children:[(0,t.jsxs)(m.A,{label:\\"Colaborador\\",id:\\"employeeId\\",value:b.employeeId,onChange:e=>{let a=e.target.value,t=s.find(e=>e.uid===a);f(e=>({...e,employeeId:a,employeeName:t?t.name:\\"\\"}))},disabled:i||p,required:!0,children:[(0,t.jsx)(\\"option\\",{value:\\"\\",disabled:!0,children:i?\\"Cargando...\\":\\"Seleccione un colaborador\\"}),s.map(e=>(0,t.jsxs)(\\"option\\",{value:e.uid,children:[e.name,\\" (Leg: \\",e.fileNumber||\\"S/N\\",\\")\\"]},e.uid))]}),(0,t.jsx)(m.A,{label:\\"Tipo de Novedad\\",id:\\"type\\",value:b.type,onChange:e=>f(a=>({...a,type:e.target.value})),disabled:p,required:!0,children:u.map(e=>(0,t.jsx)(\\"option\\",{value:e.value,children:e.label},e.value))}),(0,t.jsxs)(\\"div\\",{className:\\"grid grid-cols-1 md:grid-cols-2 gap-6\\",children:[(0,t.jsx)(c.A,{label:\\"Fecha de Inicio\\",id:\\"startDate\\",type:\\"date\\",value:b.startDate.toISOString().slice(0,10),onChange:e=>v(\\"startDate\\",e.target.value),disabled:p,required:!0}),(0,t.jsx)(c.A,{label:\\"Fecha de Fin\\",id:\\"endDate\\",type:\\"date\\",value:b.endDate.toISOString().slice(0,10),onChange:e=>v(\\"endDate\\",e.target.value),disabled:p,required:!0})]}),(0,t.jsx)(c.A,{label:\\"Raz\\\\xf3n / Comentarios\\",id:\\"reason\\",type:\\"textarea\\",value:b.reason,onChange:e=>f(a=>({...a,reason:e.target.value})),rows:3,disabled:p,required:!0,placeholder:\\"Detalle el motivo de la ausencia...\\"}),(0,t.jsx)(\\"div\\",{className:\\"flex justify-end pt-4 border-t border-gray-100\\",children:(0,t.jsx)(x.A,{type:\\"submit\\",disabled:p||!b.employeeId,primary:!0,className:\\"w-full md:w-auto\\",children:p?(0,t.jsxs)(\\"span\\",{className:\\"flex items-center\\",children:[(0,t.jsxs)(\\"svg\\",{className:\\"animate-spin -ml-1 mr-2 h-4 w-4 text-white\\",fill:\\"none\\",viewBox:\\"0 0 24 24\\",children:[(0,t.jsx)(\\"circle\\",{className:\\"opacity-25\\",cx:\\"12\\",cy:\\"12\\",r:\\"10\\",stroke:\\"currentColor\\",strokeWidth:\\"4\\"}),(0,t.jsx)(\\"path\\",{className:\\"opacity-75\\",fill:\\"currentColor\\",d:\\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\\"})]}),\\"Validando y Registrando...\\"]}):\\"Registrar Novedad\\"})})]})})]}):(0,t.jsxs)(\\"div\\",{className:\\"flex flex-col items-center justify-center h-64 bg-white rounded-xl shadow-sm border border-gray-200 p-8 text-center\\",children:[(0,t.jsx)(\\"div\\",{className:\\"bg-orange-100 p-3 rounded-full mb-4\\",children:(0,t.jsx)(\\"svg\\",{className:\\"w-8 h-8 text-orange-500\\",fill:\\"none\\",stroke:\\"currentColor\\",viewBox:\\"0 0 24 24\\",children:(0,t.jsx)(\\"path\\",{strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",strokeWidth:2,d:\\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\\"})})}),(0,t.jsx)(\\"h3\\",{className:\\"text-lg font-bold text-gray-800\\",children:\\"Selecci\\\\xf3n Requerida\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-gray-500 mt-2\\",children:\\"Por favor, seleccione una empresa en el men\\\\xfa lateral para gestionar las novedades de su personal.\\"})]})}let p=(0,l.g)(function(){return(0,t.jsx)(i.A,{title:\\"Novedades y Gesti\\\\xf3n de Ausencias\\",children:(0,t.jsx)(h,{})})},[\\"admin\\",\\"hr_manager\\"])},4104:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>r});var t=s(7876);function r({label:e,id:a,type:s=\\"text\\",rows:r=1,className:l,...i}){let n=\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 p-2 text-sm\\";return(0,t.jsxs)(\\"div\\",{className:`space-y-1 ${l}`,children:[(0,t.jsx)(\\"label\\",{htmlFor:a,className:\\"block text-sm font-medium text-gray-700\\",children:e}),\\"textarea\\"===s?(0,t.jsx)(\\"textarea\\",{id:a,className:n,rows:r,...i}):(0,t.jsx)(\\"input\\",{id:a,type:s,className:n,...i})]})}s(4232)},6372:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>r});var t=s(7876);function r({label:e,id:a,children:s,className:r,...l}){return(0,t.jsxs)(\\"div\\",{className:`space-y-1 ${r}`,children:[(0,t.jsx)(\\"label\\",{htmlFor:a,className:\\"block text-sm font-medium text-gray-700\\",children:e}),(0,t.jsx)(\\"select\\",{id:a,className:\\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 py-2 text-sm\\",...l,children:s})]})}s(4232)},8753:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>N});var t=s(7876);s(4232);var r=s(8230),l=s.n(r),i=s(9099),n=s(9423),o=s(8264),d=s(5201),c=s(9065),m=s(1538),x=s(4763),u=s(4560),h=s(8423),p=s(6068),g=s(5164),b=s(4302),f=s(3657),v=s(7932),y=s(6647);function j(){let e=(0,i.useRouter)(),{clients:a,selectedClientId:s,setClient:r}=(0,y.t)(),j=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:m.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:x.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:u.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,t.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,t.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,t.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,t.jsxs)(\\"select\\",{value:s,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),a.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,t.jsx)(g.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,t.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,t.jsx)(l(),{href:\\"/admin/home\\",children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,t.jsx)(b.A,{size:18}),\\" Inicio\\"]})}),j.map(a=>(0,t.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,t.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:a.title}),a.items.map(a=>(0,t.jsx)(l(),{href:a.href,children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===a.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,t.jsx)(a.icon,{size:16}),\\" \\",a.label]})},a.href))]},a.title))]}),(0,t.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,t.jsxs)(\\"button\\",{onClick:()=>v.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,t.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function N({children:e,title:a}){return(0,t.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,t.jsx)(j,{}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,t.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,t.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:a})}),(0,t.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,t.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}},9120:(e,a,s)=>{\\"use strict\\";s.d(a,{A:()=>r});var t=s(7876);function r({primary:e=!0,children:a,className:s,disabled:r,...l}){return(0,t.jsx)(\\"button\\",{className:`px-4 py-2 rounded-lg font-semibold transition-colors duration-150 ${e?\\"bg-indigo-600 text-white hover:bg-indigo-700 disabled:bg-indigo-300\\":\\"bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:bg-gray-100\\"} ${s||\\"\\"}`,disabled:r,...l,children:a})}s(4232)},9260:(e,a,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/rrhh/novedades\\",function(){return s(1961)}])}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=9260)),_N_E=e.O()}]);"},{"name":"status-ebecaf38c9e75599.js","path":"apps/web/out/_next/static/chunks/pages/admin/status-ebecaf38c9e75599.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[510],{858:(e,s,t)=>{\\"use strict\\";t.d(s,{g:()=>o});var a=t(7876),r=t(4232),l=t(9099),n=t(5176),i=t(7932);let o=(e,s=[\\"admin\\"])=>{let t=Array.isArray(s)?s:[s];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",t),s=>{let o=(0,l.useRouter)(),[d,c]=(0,r.useState)(!0),[x,m]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,n.hg)(i.j2,async e=>{if(!e)return void o.replace(\\"/\\");m(e);try{let s=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${s}`),t.includes(s)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${s}\' no autorizado.`),o.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),o.replace(\\"/\\")}});return()=>e()},[o]),d)?(0,a.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,a.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,a.jsx)(e,{...s,currentUser:x})}}},1820:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/status\\",function(){return t(5757)}])},5757:(e,s,t)=>{\\"use strict\\";t.r(s),t.d(s,{default:()=>d});var a=t(7876),r=t(4232),l=t(858),n=t(8753),i=t(7932);function o(){let[e,s]=(0,r.useState)([{name:\\"Conectividad Internet\\",status:\\"pending\\"},{name:\\"Sesi\\\\xf3n de Usuario (Auth)\\",status:\\"pending\\"},{name:\\"Servidor (Cloud Functions)\\",status:\\"pending\\"},{name:\\"Base de Datos (Firestore)\\",status:\\"pending\\"},{name:\\"M\\\\xf3dulo Jerarqu\\\\xeda\\",status:\\"pending\\"},{name:\\"M\\\\xf3dulo RRHH\\",status:\\"pending\\"}]),[t,l]=(0,r.useState)(!1);(0,r.useEffect)(()=>{o()},[]);let n=(e,t,a,r=\\"\\")=>{s(s=>{let l=[...s];return l[e]={...l[e],status:t,value:a,details:r},l})},o=async()=>{l(!0);let e=navigator.onLine;if(n(0,e?\\"ok\\":\\"error\\",e?\\"Online\\":\\"Offline\\"),!e)return void l(!1);let s=i.j2.currentUser;n(1,s?\\"ok\\":\\"error\\",s?\\"Autenticado\\":\\"Sin Sesi\\\\xf3n\\",s?.uid);let t=Date.now();try{let e=await (0,i.eg)({}),s=Date.now(),a=e.data;n(2,\\"ok\\",`${s-t}ms`,`Node ${a.nodeVersion}`);let r=a.database.latencyMs;n(3,\\"connected\\"===a.database.status?\\"ok\\":\\"error\\",`${r}ms`)}catch(e){n(2,\\"error\\",\\"Fallo Cr\\\\xedtico\\",e.message),n(3,\\"error\\",\\"Inaccesible\\",\\"Timeout o Error 500\\")}await d(4,async()=>(0,i.Jo)({action:\\"GET_ALL_CLIENTS\\",payload:{}})),await d(5,async()=>(0,i.r6)({action:\\"GET_ALL_EMPLOYEES\\",payload:{}})),l(!1)},d=async(e,s)=>{let t=Date.now();try{await s(),n(e,\\"ok\\",`${Date.now()-t}ms`,\\"Operativo\\")}catch(s){n(e,\\"error\\",\\"Fallo\\",s.message)}};return(0,a.jsxs)(\\"div\\",{className:\\"bg-white p-6 rounded-xl shadow-sm border border-slate-200\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"flex justify-between items-center mb-6\\",children:[(0,a.jsx)(\\"h3\\",{className:\\"font-bold text-slate-800 text-lg\\",children:\\"Monitor de Salud\\"}),(0,a.jsx)(\\"button\\",{onClick:o,disabled:t,className:\\"px-4 py-2 bg-indigo-50 text-indigo-700 rounded-lg text-sm font-bold hover:bg-indigo-100 disabled:opacity-50\\",children:t?\\"Escaneando...\\":\\"Re-escanear\\"})]}),(0,a.jsx)(\\"div\\",{className:\\"grid grid-cols-1 md:grid-cols-2 gap-4\\",children:e.map((e,s)=>(0,a.jsxs)(\\"div\\",{className:`p-4 rounded-lg border flex items-center justify-between ${\\"ok\\"===e.status?\\"bg-green-50 border-green-100\\":\\"error\\"===e.status?\\"bg-red-50 border-red-100\\":\\"bg-gray-50\\"}`,children:[(0,a.jsxs)(\\"div\\",{children:[(0,a.jsx)(\\"p\\",{className:\\"text-xs font-bold text-gray-500 uppercase mb-1\\",children:e.name}),(0,a.jsxs)(\\"div\\",{className:\\"flex items-center gap-2\\",children:[(0,a.jsx)(\\"div\\",{className:`w-2.5 h-2.5 rounded-full ${\\"ok\\"===e.status?\\"bg-green-500\\":\\"error\\"===e.status?\\"bg-red-500\\":\\"bg-yellow-400 animate-pulse\\"}`}),(0,a.jsx)(\\"span\\",{className:\\"font-bold text-slate-700\\",children:\\"pending\\"===e.status?\\"...\\":e.value})]})]}),e.details&&(0,a.jsx)(\\"div\\",{className:\\"text-xs text-gray-500 text-right max-w-[120px] truncate\\",title:e.details,children:e.details})]},s))})]})}let d=(0,l.g)(function(){return(0,a.jsx)(n.A,{title:\\"Diagn\\\\xf3stico de Sistema\\",children:(0,a.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,a.jsx)(o,{})})})},[\\"admin\\"])},8753:(e,s,t)=>{\\"use strict\\";t.d(s,{A:()=>w});var a=t(7876);t(4232);var r=t(8230),l=t.n(r),n=t(9099),i=t(9423),o=t(8264),d=t(5201),c=t(9065),x=t(1538),m=t(4763),u=t(4560),h=t(8423),p=t(6068),b=t(5164),g=t(4302),f=t(3657),j=t(7932),v=t(6647);function N(){let e=(0,n.useRouter)(),{clients:s,selectedClientId:t,setClient:r}=(0,v.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:i.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:o.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:d.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:u.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:h.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,a.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,a.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,a.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,a.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,a.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,a.jsxs)(\\"select\\",{value:t,onChange:e=>r(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,a.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),s.map(e=>(0,a.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,a.jsx)(b.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,a.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,a.jsx)(l(),{href:\\"/admin/home\\",children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,a.jsx)(g.A,{size:18}),\\" Inicio\\"]})}),N.map(s=>(0,a.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,a.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:s.title}),s.items.map(s=>(0,a.jsx)(l(),{href:s.href,children:(0,a.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===s.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,a.jsx)(s.icon,{size:16}),\\" \\",s.label]})},s.href))]},s.title))]}),(0,a.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,a.jsxs)(\\"button\\",{onClick:()=>j.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,a.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function w({children:e,title:s}){return(0,a.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,a.jsx)(N,{}),(0,a.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,a.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,a.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:s})}),(0,a.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,a.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=1820)),_N_E=e.O()}]);"},{"name":"system-users-6abb74606cff7624.js","path":"apps/web/out/_next/static/chunks/pages/admin/system-users-6abb74606cff7624.js","area":"FRONTEND","folder":"ADMIN","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[300],{436:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/admin/system-users\\",function(){return a(1799)}])},858:(e,s,a)=>{\\"use strict\\";a.d(s,{g:()=>d});var t=a(7876),l=a(4232),r=a(9099),i=a(5176),n=a(7932);let d=(e,s=[\\"admin\\"])=>{let a=Array.isArray(s)?s:[s];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",a),s=>{let d=(0,r.useRouter)(),[o,c]=(0,l.useState)(!0),[x,m]=(0,l.useState)(null);return((0,l.useEffect)(()=>{let e=(0,i.hg)(n.j2,async e=>{if(!e)return void d.replace(\\"/\\");m(e);try{let s=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${s}`),a.includes(s)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${s}\' no autorizado.`),d.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),d.replace(\\"/\\")}});return()=>e()},[d]),o)?(0,t.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,t.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,t.jsx)(e,{...s,currentUser:x})}}},1799:(e,s,a)=>{\\"use strict\\";a.r(s),a.d(s,{default:()=>c});var t=a(7876),l=a(4232),r=a(858),i=a(8753),n=a(7932),d=a(7685);function o(){let[e,s]=(0,l.useState)([]),[a,r]=(0,l.useState)(!0),[i,o]=(0,l.useState)(!1),[c,x]=(0,l.useState)(!1),[m,h]=(0,l.useState)({uid:\\"\\",displayName:\\"\\",email:\\"\\",password:\\"\\",role:\\"Scheduler\\",status:\\"Active\\"}),u=async()=>{r(!0);try{let e=(await (0,n.$H)({action:\\"GET_ALL_USERS\\",payload:{}})).data.data||[];s(e)}catch(e){console.error(e),d.Ay.error(\\"Error al cargar usuarios.\\")}finally{r(!1)}};(0,l.useEffect)(()=>{u()},[]);let p=async e=>{e.preventDefault();let s=d.Ay.loading(\\"Procesando...\\");try{if(c){let e={uid:m.uid,data:{role:m.role,status:m.status,displayName:m.displayName}};await (0,n.$H)({action:\\"UPDATE_USER\\",payload:e}),d.Ay.success(\\"Usuario actualizado\\",{id:s})}else await (0,n.$H)({action:\\"CREATE_USER\\",payload:{email:m.email,password:m.password,displayName:m.displayName,role:m.role}}),d.Ay.success(\\"Administrador creado\\",{id:s});o(!1),u()}catch(e){d.Ay.error(`Error: ${e.message}`,{id:s})}},g=async e=>{if(confirm(\\"\\\\xbfEliminar este administrador? Perder\\\\xe1 el acceso inmediatamente.\\"))try{await (0,n.$H)({action:\\"DELETE_USER\\",payload:{uid:e}}),d.Ay.success(\\"Usuario eliminado\\"),u()}catch(e){d.Ay.error(\\"Error al eliminar\\")}},b=\\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\\",f=\\"block text-sm font-medium text-gray-700\\";return(0,t.jsxs)(\\"div\\",{className:\\"space-y-6\\",children:[(0,t.jsxs)(\\"div\\",{className:\\"flex justify-between items-center\\",children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"h2\\",{className:\\"text-xl font-bold text-gray-800\\",children:\\"Usuarios del Sistema\\"}),(0,t.jsx)(\\"p\\",{className:\\"text-sm text-gray-500\\",children:\\"Gestione el acceso al panel administrativo.\\"})]}),(0,t.jsxs)(\\"button\\",{onClick:()=>{h({uid:\\"\\",displayName:\\"\\",email:\\"\\",password:\\"\\",role:\\"Scheduler\\",status:\\"Active\\"}),x(!1),o(!0)},className:\\"bg-gray-800 text-white px-4 py-2 rounded-lg hover:bg-gray-900 transition shadow-sm flex items-center\\",children:[(0,t.jsx)(\\"span\\",{className:\\"mr-2\\",children:\\"+\\"}),\\" Nuevo Admin\\"]})]}),(0,t.jsx)(\\"div\\",{className:\\"bg-white shadow-sm rounded-xl border border-gray-200 overflow-hidden\\",children:(0,t.jsxs)(\\"table\\",{className:\\"min-w-full divide-y divide-gray-200\\",children:[(0,t.jsx)(\\"thead\\",{className:\\"bg-gray-50\\",children:(0,t.jsxs)(\\"tr\\",{children:[(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Usuario\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Rol\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-left text-xs font-bold text-gray-500 uppercase\\",children:\\"Estado\\"}),(0,t.jsx)(\\"th\\",{className:\\"px-6 py-3 text-right text-xs font-bold text-gray-500 uppercase\\",children:\\"Acciones\\"})]})}),(0,t.jsx)(\\"tbody\\",{className:\\"bg-white divide-y divide-gray-200\\",children:e.map(e=>(0,t.jsxs)(\\"tr\\",{className:\\"hover:bg-gray-50\\",children:[(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,t.jsxs)(\\"div\\",{className:\\"flex items-center\\",children:[(0,t.jsx)(\\"div\\",{className:\\"h-8 w-8 rounded-full bg-gray-200 flex items-center justify-center text-gray-600 font-bold text-xs\\",children:e.displayName.charAt(0)}),(0,t.jsxs)(\\"div\\",{className:\\"ml-3\\",children:[(0,t.jsx)(\\"div\\",{className:\\"text-sm font-medium text-gray-900\\",children:e.displayName}),(0,t.jsx)(\\"div\\",{className:\\"text-xs text-gray-500\\",children:e.email})]})]})}),(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,t.jsx)(\\"span\\",{className:\\"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-indigo-100 text-indigo-800\\",children:e.role})}),(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap\\",children:(0,t.jsx)(\\"span\\",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${\\"Active\\"===e.status?\\"bg-green-100 text-green-800\\":\\"bg-red-100 text-red-800\\"}`,children:e.status})}),(0,t.jsx)(\\"td\\",{className:\\"px-6 py-4 whitespace-nowrap text-right text-sm font-medium\\",children:(0,t.jsx)(\\"button\\",{onClick:()=>g(e.uid),className:\\"text-red-600 hover:text-red-900\\",children:\\"Eliminar\\"})})]},e.uid))})]})}),i&&(0,t.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 overflow-y-auto bg-black bg-opacity-50 flex items-center justify-center p-4\\",children:(0,t.jsxs)(\\"div\\",{className:\\"bg-white rounded-xl shadow-xl max-w-md w-full p-6\\",children:[(0,t.jsx)(\\"h3\\",{className:\\"text-lg font-bold text-gray-900 mb-4\\",children:c?\\"Editar Usuario\\":\\"Nuevo Administrador\\"}),(0,t.jsxs)(\\"form\\",{onSubmit:p,className:\\"space-y-4\\",children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"label\\",{className:f,children:\\"Nombre\\"}),(0,t.jsx)(\\"input\\",{className:b,value:m.displayName,onChange:e=>h({...m,displayName:e.target.value}),required:!0})]}),!c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"label\\",{className:f,children:\\"Email\\"}),(0,t.jsx)(\\"input\\",{type:\\"email\\",className:b,value:m.email,onChange:e=>h({...m,email:e.target.value}),required:!0})]}),(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"label\\",{className:f,children:\\"Contrase\\\\xf1a\\"}),(0,t.jsx)(\\"input\\",{type:\\"password\\",className:b,value:m.password,onChange:e=>h({...m,password:e.target.value}),required:!0})]})]}),(0,t.jsxs)(\\"div\\",{children:[(0,t.jsx)(\\"label\\",{className:f,children:\\"Rol de Sistema\\"}),(0,t.jsxs)(\\"select\\",{className:b,value:m.role,onChange:e=>h({...m,role:e.target.value}),children:[(0,t.jsx)(\\"option\\",{value:\\"SuperAdmin\\",children:\\"Super Admin (Total)\\"}),(0,t.jsx)(\\"option\\",{value:\\"Scheduler\\",children:\\"Planificador (Turnos)\\"}),(0,t.jsx)(\\"option\\",{value:\\"HR_Manager\\",children:\\"RRHH (Empleados)\\"}),(0,t.jsx)(\\"option\\",{value:\\"Viewer\\",children:\\"Solo Lectura\\"})]})]}),(0,t.jsxs)(\\"div\\",{className:\\"flex justify-end space-x-3 mt-6\\",children:[(0,t.jsx)(\\"button\\",{type:\\"button\\",onClick:()=>o(!1),className:\\"px-4 py-2 text-gray-700 bg-gray-100 rounded-lg\\",children:\\"Cancelar\\"}),(0,t.jsx)(\\"button\\",{type:\\"submit\\",className:\\"px-4 py-2 text-white bg-gray-900 rounded-lg hover:bg-black\\",children:\\"Guardar\\"})]})]})]})})]})}let c=(0,r.g)(function(){return(0,t.jsx)(i.A,{title:\\"Gesti\\\\xf3n de Usuarios del Sistema\\",children:(0,t.jsx)(o,{})})},[\\"admin\\"])},8753:(e,s,a)=>{\\"use strict\\";a.d(s,{A:()=>v});var t=a(7876);a(4232);var l=a(8230),r=a.n(l),i=a(9099),n=a(9423),d=a(8264),o=a(5201),c=a(9065),x=a(1538),m=a(4763),h=a(4560),u=a(8423),p=a(6068),g=a(5164),b=a(4302),f=a(3657),y=a(7932),j=a(6647);function N(){let e=(0,i.useRouter)(),{clients:s,selectedClientId:a,setClient:l}=(0,j.t)(),N=[{title:\\"PLANIFICACI\\\\xd3N\\",items:[{href:\\"/admin/planning/matrix\\",icon:n.A,label:\\"Matriz\\"},{href:\\"/admin/dashboard\\",icon:d.A,label:\\"Calendario\\"},{href:\\"/admin/planning/gantt\\",icon:o.A,label:\\"Gantt\\"}]},{title:\\"GESTI\\\\xd3N\\",items:[{href:\\"/admin/clients\\",icon:c.A,label:\\"Clientes\\"},{href:\\"/admin/employees\\",icon:x.A,label:\\"Personal\\"},{href:\\"/admin/objective-management\\",icon:m.A,label:\\"Objetivos\\"},{href:\\"/admin/rrhh/novedades\\",icon:h.A,label:\\"Novedades\\"}]},{title:\\"SISTEMA\\",items:[{href:\\"/admin/status\\",icon:u.A,label:\\"Diagn\\\\xf3stico\\"},{href:\\"/admin/system-users\\",icon:p.A,label:\\"Usuarios Sistema\\"}]}];return(0,t.jsxs)(\\"aside\\",{className:\\"w-64 bg-slate-900 h-screen flex flex-col border-r border-slate-800 sticky top-0 z-50 overflow-hidden shadow-2xl\\",children:[(0,t.jsx)(\\"div\\",{className:\\"p-6\\",children:(0,t.jsx)(\\"h1\\",{className:\\"text-xl font-black text-white italic tracking-tighter uppercase\\",children:\\"CronoApp\\"})}),(0,t.jsxs)(\\"div\\",{className:\\"px-5 mb-6\\",children:[(0,t.jsx)(\\"p\\",{className:\\"text-[9px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1\\",children:\\"Contexto Operativo\\"}),(0,t.jsxs)(\\"div\\",{className:\\"relative\\",children:[(0,t.jsxs)(\\"select\\",{value:a,onChange:e=>l(e.target.value),className:\\"w-full bg-slate-800 border border-slate-700 text-slate-200 text-xs rounded-xl px-3 py-2.5 appearance-none outline-none cursor-pointer\\",children:[(0,t.jsx)(\\"option\\",{value:\\"\\",children:\\"\\\\uD83C\\\\uDFE2 Ver Toda la Operaci\\\\xf3n\\"}),s.map(e=>(0,t.jsx)(\\"option\\",{value:e.id,children:e.businessName||e.name},e.id))]}),(0,t.jsx)(g.A,{className:\\"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none\\",size:14})]})]}),(0,t.jsxs)(\\"nav\\",{className:\\"flex-1 px-3 space-y-4 overflow-y-auto pb-4 custom-scrollbar\\",children:[(0,t.jsx)(r(),{href:\\"/admin/home\\",children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all ${\\"/admin/home\\"===e.pathname?\\"bg-indigo-600 text-white shadow-lg\\":\\"text-slate-400 hover:bg-slate-800\\"}`,children:[(0,t.jsx)(b.A,{size:18}),\\" Inicio\\"]})}),N.map(s=>(0,t.jsxs)(\\"div\\",{className:\\"space-y-1\\",children:[(0,t.jsx)(\\"p\\",{className:\\"px-4 text-[9px] font-black text-slate-600 uppercase tracking-widest mb-1\\",children:s.title}),s.items.map(s=>(0,t.jsx)(r(),{href:s.href,children:(0,t.jsxs)(\\"div\\",{className:`flex items-center gap-3 px-4 py-1.5 rounded-xl text-xs font-medium transition-all ${e.pathname===s.href?\\"bg-slate-800 text-indigo-400 border border-slate-700\\":\\"text-slate-500 hover:bg-slate-800/50 hover:text-slate-300\\"}`,children:[(0,t.jsx)(s.icon,{size:16}),\\" \\",s.label]})},s.href))]},s.title))]}),(0,t.jsx)(\\"div\\",{className:\\"p-4 border-t border-slate-800 bg-slate-900/50\\",children:(0,t.jsxs)(\\"button\\",{onClick:()=>y.j2.signOut().then(()=>window.location.href=\\"/\\"),className:\\"flex items-center gap-3 px-4 py-2.5 w-full rounded-xl text-xs font-bold text-slate-500 hover:bg-red-500/10 hover:text-red-400 transition-all\\",children:[(0,t.jsx)(f.A,{size:16}),\\" Cerrar Sesi\\\\xf3n\\"]})})]})}function v({children:e,title:s}){return(0,t.jsxs)(\\"div\\",{className:\\"flex h-screen bg-slate-50\\",children:[(0,t.jsx)(N,{}),(0,t.jsxs)(\\"div\\",{className:\\"flex-1 flex flex-col h-screen overflow-hidden\\",children:[(0,t.jsx)(\\"header\\",{className:\\"h-16 bg-white border-b border-slate-200 flex items-center px-8 sticky top-0 z-20 shadow-sm\\",children:(0,t.jsx)(\\"h2\\",{className:\\"text-lg font-bold text-slate-800\\",children:s})}),(0,t.jsx)(\\"main\\",{className:\\"flex-1 overflow-y-auto p-8 bg-[#F8FAFC]\\",children:(0,t.jsx)(\\"div\\",{className:\\"max-w-7xl mx-auto h-full\\",children:e})})]})]})}}},e=>{e.O(0,[212,636,593,792],()=>e(e.s=436)),_N_E=e.O()}]);"},{"name":"dashboard-5075a1c18c2daeb1.js","path":"apps/web/out/_next/static/chunks/pages/employee/dashboard-5075a1c18c2daeb1.js","area":"FRONTEND","folder":"EMPLOYEE","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[369],{858:(e,t,s)=>{\\"use strict\\";s.d(t,{g:()=>n});var a=s(7876),r=s(4232),o=s(9099),l=s(5176),i=s(7932);let n=(e,t=[\\"admin\\"])=>{let s=Array.isArray(t)?t:[t];return console.log(\\"[DEBUG GUARD] Roles Requeridos:\\",s),t=>{let n=(0,o.useRouter)(),[d,c]=(0,r.useState)(!0),[m,u]=(0,r.useState)(null);return((0,r.useEffect)(()=>{let e=(0,l.hg)(i.j2,async e=>{if(!e)return void n.replace(\\"/\\");u(e);try{let t=(await e.getIdTokenResult(!0)).claims.role;console.log(`[DEBUG GUARD] Usuario: ${e.email} | Rol: ${t}`),s.includes(t)?c(!1):(console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${t}\' no autorizado.`),n.replace(\\"/\\"))}catch(e){console.error(\\"❌ [GUARD] Error validando rol:\\",e),n.replace(\\"/\\")}});return()=>e()},[n]),d)?(0,a.jsxs)(\\"div\\",{className:\\"min-h-screen flex flex-col items-center justify-center bg-gray-50\\",children:[(0,a.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mb-4\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium animate-pulse\\",children:\\"Verificando permisos...\\"})]}):(0,a.jsx)(e,{...t,currentUser:m})}}},8270:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/employee/dashboard\\",function(){return s(8466)}])},8466:(e,t,s)=>{\\"use strict\\";s.r(t),s.d(t,{default:()=>c});var a=s(7876),r=s(4232),o=s(9099),l=s(858),i=s(7932),n=s(7685);function d({currentUser:e}){let t,[s,o]=(0,r.useState)([]),[l,d]=(0,r.useState)(!0),[c,m]=(0,r.useState)(\\"week\\"),[u,x]=(0,r.useState)(null),[g,h]=(0,r.useState)(!1),[p,b]=(0,r.useState)(!1),[f,j]=(0,r.useState)(null),[y,w]=(0,r.useState)(\\"\\"),N=e=>e?\\"function\\"==typeof e.toDate?e.toDate():e instanceof Date?e:void 0!==e.seconds?new Date(1e3*e.seconds):\\"string\\"==typeof e?new Date(e):new Date:new Date,v=async()=>{d(!0);try{let t=(await (0,i.getEmployeeShifts)(e.uid)).sort((e,t)=>N(e.startTime).getTime()-N(t.startTime).getTime());o(t)}catch(e){console.error(e),n.Ay.error(\\"Error al cargar agenda.\\")}finally{d(!1)}};(0,r.useEffect)(()=>{e&&v()},[e]);let E=e=>N(e).toLocaleTimeString(\\"es-AR\\",{hour:\\"2-digit\\",minute:\\"2-digit\\"}),D=async(e,t)=>{if(g||u)return;x(e),h(!0);let s=n.Ay.loading(\\"CHECK_IN\\"===t?\\"Validando ubicaci\\\\xf3n...\\":\\"Cerrando servicio...\\");try{let a=await function(e=1e4){return new Promise((t,s)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(e=>{t({latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy})},e=>{let t=\\"Error desconocido de ubicaci\\\\xf3n.\\";switch(e.code){case e.PERMISSION_DENIED:t=\\"Permiso de ubicaci\\\\xf3n denegado. Habil\\\\xedtalo en tu navegador.\\";break;case e.POSITION_UNAVAILABLE:t=\\"Se\\\\xf1al GPS no disponible.\\";break;case e.TIMEOUT:t=\\"Se agot\\\\xf3 el tiempo buscando se\\\\xf1al GPS.\\"}s(Error(t))},{enableHighAccuracy:!0,timeout:e,maximumAge:0}):s(Error(\\"Tu navegador no soporta geolocalizaci\\\\xf3n.\\"))})}();await (0,i.callAuditShift)({shiftId:e,action:t,coords:{latitude:a.latitude,longitude:a.longitude}}),n.Ay.success(\\"CHECK_IN\\"===t?\\"✅ \\\\xa1Presente registrado!\\":\\"\\\\uD83C\\\\uDFC1 \\\\xa1Servicio finalizado!\\",{id:s}),await v()}catch(t){let e=\\"Error al procesar.\\";t.message?.includes(\\"temprano\\")?e=\\"⏳ Es muy temprano (10 min antes).\\":t.message?.includes(\\"cerca\\")||\\"functions/failed-precondition\\"===t.code?e=\\"\\\\uD83D\\\\uDCCD Est\\\\xe1s demasiado lejos.\\":t.message?.includes(\\"Permiso\\")&&(e=\\"⚠️ Activa el GPS.\\"),n.Ay.error(e,{id:s,duration:5e3})}finally{x(null),h(!1)}},C=async()=>{if(!f||!y.trim())return void n.Ay.error(\\"Por favor indique el motivo.\\");let t=n.Ay.loading(\\"Registrando ausencia...\\");try{let s=N(f.startTime),a=N(f.endTime);await (0,i.createAbsence)({action:\\"CREATE_ABSENCE\\",payload:{employeeId:e.uid,employeeName:e.displayName||\\"Empleado\\",clientId:f.objectiveId||\\"unknown\\",type:\\"SICK_LEAVE\\",startDate:s,endDate:a,reason:`[App] ${y}`}}),n.Ay.success(\\"Ausencia reportada correctamente.\\",{id:t}),b(!1),w(\\"\\"),await v()}catch(e){console.error(e),n.Ay.error(\\"Error: \\"+(e.message||\\"Fallo desconocido\\"),{id:t})}};if(l)return(0,a.jsx)(\\"div\\",{className:\\"p-10 text-center animate-pulse text-gray-500\\",children:\\"Cargando agenda...\\"});let k=(t=new Date,s.filter(e=>{let s=N(e.startTime);if(\\"day\\"===c)return s.getDate()===t.getDate()&&s.getMonth()===t.getMonth()&&s.getFullYear()===t.getFullYear();if(\\"week\\"===c){let e=new Date;e.setDate(t.getDate()+7);let a=new Date(s);a.setHours(0,0,0,0);let r=new Date(t);return r.setHours(0,0,0,0),a>=r&&a<=e}return\\"month\\"!==c||s.getMonth()===t.getMonth()&&s.getFullYear()===t.getFullYear()})),A=s.find(e=>\\"Assigned\\"===e.status||\\"InProgress\\"===e.status);return(0,a.jsxs)(\\"div\\",{className:\\"max-w-2xl mx-auto pb-24 px-4 font-sans\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"bg-gradient-to-r from-indigo-600 to-blue-600 rounded-2xl p-6 text-white shadow-lg mb-6 mt-4 relative overflow-hidden transition-all hover:shadow-xl\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"relative z-10\\",children:[(0,a.jsxs)(\\"h2\\",{className:\\"text-2xl font-bold mb-1\\",children:[\\"Hola, \\",e.displayName?.split(\\" \\")[0]||\\"Colaborador\\"]}),(0,a.jsx)(\\"p\\",{className:\\"text-indigo-100 text-sm mb-6\\",children:\\"Panel de Operaciones\\"}),(0,a.jsxs)(\\"div\\",{className:\\"flex gap-4\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"bg-white/10 backdrop-blur-sm rounded-lg p-3 flex-1 border border-white/10\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-xs text-indigo-200 uppercase font-bold\\",children:\\"Pr\\\\xf3ximo Turno\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-lg font-bold mt-1 truncate\\",children:A?N(A.startTime).toLocaleDateString(\\"es-AR\\",{weekday:\\"short\\",day:\\"numeric\\"}):\\"Libre\\"})]}),(0,a.jsxs)(\\"div\\",{className:\\"bg-white/10 backdrop-blur-sm rounded-lg p-3 flex-1 border border-white/10\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-xs text-indigo-200 uppercase font-bold\\",children:\\"Estado\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-lg font-bold mt-1 flex items-center gap-2\\",children:A?.status===\\"InProgress\\"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(\\"span\\",{className:\\"w-2 h-2 rounded-full bg-green-400 animate-pulse shadow-[0_0_8px_rgba(74,222,128,0.8)]\\"}),\\" En Servicio\\"]}):\\"Disponible\\"})]})]})]}),(0,a.jsx)(\\"div\\",{className:\\"absolute top-0 right-0 -mt-4 -mr-4 w-32 h-32 bg-white/10 rounded-full blur-2xl\\"}),(0,a.jsx)(\\"div\\",{className:\\"absolute bottom-0 left-0 -mb-4 -ml-4 w-24 h-24 bg-indigo-500/20 rounded-full blur-xl\\"})]}),(0,a.jsx)(\\"div\\",{className:\\"flex bg-gray-100 p-1 rounded-xl mb-6 shadow-inner\\",children:[\\"day\\",\\"week\\",\\"month\\"].map(e=>(0,a.jsx)(\\"button\\",{onClick:()=>m(e),className:`flex-1 py-2 text-sm font-bold rounded-lg transition-all capitalize ${c===e?\\"bg-white text-indigo-600 shadow-sm transform scale-[1.02]\\":\\"text-gray-500 hover:text-gray-700\\"}`,children:\\"day\\"===e?\\"Hoy\\":\\"week\\"===e?\\"Semana\\":\\"Mes\\"},e))}),(0,a.jsx)(\\"div\\",{className:\\"space-y-5\\",children:0===k.length?(0,a.jsxs)(\\"div\\",{className:\\"flex flex-col items-center justify-center py-12 bg-white rounded-2xl border border-dashed border-gray-200 text-center\\",children:[(0,a.jsx)(\\"span\\",{className:\\"text-4xl mb-3\\",children:\\"\\\\uD83D\\\\uDCC5\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-gray-500 font-medium\\",children:\\"No hay servicios programados.\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-sm text-gray-400\\",children:\\"Selecciona otro filtro para ver m\\\\xe1s.\\"})]}):k.map(e=>(0,a.jsxs)(\\"div\\",{className:\\"bg-white rounded-2xl shadow-md border border-slate-100 overflow-hidden hover:shadow-lg transition-all duration-300\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"bg-slate-50 px-5 py-4 border-b border-slate-100 flex justify-between items-center\\",children:[(0,a.jsxs)(\\"div\\",{children:[(0,a.jsx)(\\"span\\",{className:\\"font-bold text-gray-800 block truncate max-w-[180px] sm:max-w-xs\\",children:e.objectiveName||\\"Objetivo\\"}),(0,a.jsx)(\\"span\\",{className:\\"text-xs text-gray-500 uppercase tracking-wider\\",children:e.role||\\"Vigilador\\"})]}),(0,a.jsx)(\\"span\\",{className:`text-[10px] px-2.5 py-1 rounded-full font-bold uppercase border ${\\"InProgress\\"===e.status?\\"bg-indigo-50 text-indigo-700 border-indigo-100 animate-pulse\\":\\"Completed\\"===e.status?\\"bg-green-50 text-green-700 border-green-100\\":\\"bg-white text-slate-500 border-slate-200\\"}`,children:\\"Assigned\\"===e.status?\\"Pendiente\\":e.status})]}),(0,a.jsxs)(\\"div\\",{className:\\"p-5\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"flex justify-between mb-5 text-sm\\",children:[(0,a.jsxs)(\\"div\\",{children:[(0,a.jsx)(\\"p\\",{className:\\"text-gray-400 text-[10px] font-bold uppercase mb-0.5\\",children:\\"Fecha\\"}),(0,a.jsx)(\\"p\\",{className:\\"font-medium text-slate-700 capitalize\\",children:N(e.startTime).toLocaleDateString(\\"es-AR\\",{weekday:\\"long\\",day:\\"numeric\\",month:\\"long\\"})})]}),(0,a.jsxs)(\\"div\\",{className:\\"text-right\\",children:[(0,a.jsx)(\\"p\\",{className:\\"text-gray-400 text-[10px] font-bold uppercase mb-0.5\\",children:\\"Horario\\"}),(0,a.jsxs)(\\"p\\",{className:\\"font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded\\",children:[E(e.startTime),\\" - \\",E(e.endTime)]})]})]}),(0,a.jsxs)(\\"div\\",{className:\\"space-y-3\\",children:[\\"Assigned\\"===e.status&&(0,a.jsxs)(\\"div\\",{className:\\"flex gap-2\\",children:[(0,a.jsx)(\\"button\\",{onClick:()=>D(e.id,\\"CHECK_IN\\"),disabled:!!u,className:\\"flex-1 bg-emerald-600 text-white py-3 rounded-xl font-bold text-sm shadow-md hover:bg-emerald-700 transition active:scale-95 disabled:opacity-50 flex items-center justify-center gap-2\\",children:u===e.id?\\"Validando...\\":(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(\\"span\\",{children:\\"\\\\uD83D\\\\uDCCD\\"}),\\" DAR PRESENTE\\"]})}),(0,a.jsx)(\\"button\\",{onClick:()=>{j(e),b(!0)},disabled:!!u,className:\\"px-4 py-3 bg-red-50 text-red-600 border border-red-100 rounded-xl font-bold text-lg hover:bg-red-100 transition active:scale-95\\",title:\\"Reportar Ausencia / Problema\\",children:\\"\\\\uD83D\\\\uDE91\\"})]}),\\"InProgress\\"===e.status&&(0,a.jsx)(\\"button\\",{onClick:()=>D(e.id,\\"CHECK_OUT\\"),disabled:!!u,className:\\"w-full bg-rose-600 text-white py-3 rounded-xl font-bold text-sm shadow-md hover:bg-rose-700 transition active:scale-95 disabled:opacity-50 flex items-center justify-center gap-2\\",children:u===e.id?\\"Cerrando...\\":(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(\\"span\\",{children:\\"\\\\uD83C\\\\uDFC1\\"}),\\" FIN DE SERVICIO\\"]})}),\\"Completed\\"===e.status&&(0,a.jsxs)(\\"div\\",{className:\\"w-full bg-slate-50 text-slate-500 py-3 rounded-xl text-center text-sm font-medium border border-slate-200 flex items-center justify-center gap-2 cursor-default\\",children:[(0,a.jsx)(\\"svg\\",{className:\\"w-4 h-4 text-green-500\\",fill:\\"none\\",stroke:\\"currentColor\\",viewBox:\\"0 0 24 24\\",children:(0,a.jsx)(\\"path\\",{strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",strokeWidth:2,d:\\"M5 13l4 4L19 7\\"})}),\\"Servicio Completado\\"]})]})]})]},e.id))}),p&&(0,a.jsx)(\\"div\\",{className:\\"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm animate-fadeIn\\",children:(0,a.jsxs)(\\"div\\",{className:\\"bg-white rounded-2xl w-full max-w-sm p-6 shadow-2xl transform transition-all\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"flex items-center gap-3 mb-4 text-red-600\\",children:[(0,a.jsx)(\\"div\\",{className:\\"bg-red-100 p-2 rounded-full\\",children:(0,a.jsx)(\\"svg\\",{className:\\"w-6 h-6\\",fill:\\"none\\",viewBox:\\"0 0 24 24\\",stroke:\\"currentColor\\",children:(0,a.jsx)(\\"path\\",{strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",strokeWidth:2,d:\\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\\"})})}),(0,a.jsx)(\\"h3\\",{className:\\"text-lg font-bold text-gray-800\\",children:\\"Reportar Ausencia\\"})]}),(0,a.jsxs)(\\"p\\",{className:\\"text-sm text-gray-500 mb-4\\",children:[\\"\\\\xbfPor qu\\\\xe9 no podr\\\\xe1s asistir al turno en \\",(0,a.jsx)(\\"strong\\",{children:f?.objectiveName}),\\"?\\"]}),(0,a.jsx)(\\"textarea\\",{className:\\"w-full border-gray-300 rounded-xl shadow-sm focus:ring-red-500 focus:border-red-500 text-sm p-3 border mb-6\\",rows:3,placeholder:\\"Escribe el motivo aqu\\\\xed...\\",value:y,onChange:e=>w(e.target.value)}),(0,a.jsxs)(\\"div\\",{className:\\"flex gap-3\\",children:[(0,a.jsx)(\\"button\\",{onClick:()=>b(!1),className:\\"flex-1 py-3 text-gray-600 font-bold hover:bg-gray-100 rounded-xl transition bg-gray-50\\",children:\\"Cancelar\\"}),(0,a.jsx)(\\"button\\",{onClick:C,className:\\"flex-1 py-3 bg-red-600 text-white font-bold rounded-xl hover:bg-red-700 shadow-md transition active:scale-95\\",children:\\"Confirmar\\"})]})]})})]})}let c=(0,l.g)(function({currentUser:e}){(0,o.useRouter)();let t=async()=>{await i.j2.signOut(),window.location.href=\\"/\\"};return(0,a.jsxs)(\\"div\\",{className:\\"min-h-screen bg-gray-50 font-sans\\",children:[(0,a.jsxs)(\\"header\\",{className:\\"bg-white shadow-sm px-4 py-3 flex justify-between items-center sticky top-0 z-10\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"flex items-center space-x-3\\",children:[(0,a.jsx)(\\"div\\",{className:\\"bg-indigo-600 p-2 rounded-lg\\",children:(0,a.jsx)(\\"svg\\",{className:\\"w-6 h-6 text-white\\",fill:\\"none\\",stroke:\\"currentColor\\",viewBox:\\"0 0 24 24\\",children:(0,a.jsx)(\\"path\\",{strokeLinecap:\\"round\\",strokeLinejoin:\\"round\\",strokeWidth:2,d:\\"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z\\"})})}),(0,a.jsxs)(\\"div\\",{children:[(0,a.jsx)(\\"h1\\",{className:\\"text-lg font-bold text-gray-800 leading-none\\",children:\\"Mi Portal\\"}),(0,a.jsx)(\\"p\\",{className:\\"text-xs text-gray-500\\",children:e?.email})]})]}),(0,a.jsx)(\\"button\\",{onClick:t,className:\\"text-sm text-red-600 font-medium border border-red-100 px-3 py-1.5 rounded-lg hover:bg-red-50 transition-colors\\",children:\\"Salir\\"})]}),(0,a.jsx)(\\"main\\",{className:\\"p-4\\",children:(0,a.jsx)(d,{currentUser:e})})]})},[\\"employee\\"])},9099:(e,t,s)=>{e.exports=s(9603)}},e=>{e.O(0,[636,593,792],()=>e(e.s=8270)),_N_E=e.O()}]);"},{"name":"employees-d41dc32db766af7f.js","path":"apps/web/out/_next/static/chunks/pages/employee/employees-d41dc32db766af7f.js","area":"FRONTEND","folder":"EMPLOYEE","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[922],{1788:(e,n,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/employee/employees\\",function(){return s(3499)}])},3499:(e,n,s)=>{\\"use strict\\";s.r(n),s.d(n,{default:()=>a});var u=s(7876);s(4232);var _=s(858),r=s(8753),t=s(9123);let a=(0,_.g)(function(){return(0,u.jsx)(r.A,{title:\\"Gesti\\\\xf3n de Recursos Humanos\\",children:(0,u.jsx)(t.G,{})})},[\\"admin\\",\\"manager\\"])}},e=>{e.O(0,[212,995,636,593,792],()=>e(e.s=1788)),_N_E=e.O()}]);"},{"name":"index-ace76fcf5791b85b.js","path":"apps/web/out/_next/static/chunks/pages/index-ace76fcf5791b85b.js","area":"FRONTEND","folder":"PAGES","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{6760:(e,s,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/\\",function(){return r(6935)}])},6935:(e,s,r)=>{\\"use strict\\";r.r(s),r.d(s,{default:()=>d});var n=r(7876),t=r(4232),u=r(9099),i=r(5176),l=r(7932);function d(){let e=(0,u.useRouter)();return(0,t.useEffect)(()=>{let s=(0,i.hg)(l.j2,s=>{s?e.push(\\"/admin/home\\"):e.push(\\"/login\\")});return()=>s()},[e]),(0,n.jsx)(\\"div\\",{className:\\"h-screen w-full flex items-center justify-center bg-slate-900\\",children:(0,n.jsx)(\\"div\\",{className:\\"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500\\"})})}},9099:(e,s,r)=>{e.exports=r(9603)}},e=>{e.O(0,[636,593,792],()=>e(e.s=6760)),_N_E=e.O()}]);"},{"name":"login-a14fc515881e0b30.js","path":"apps/web/out/_next/static/chunks/pages/login-a14fc515881e0b30.js","area":"FRONTEND","folder":"PAGES","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[295],{6392:(e,t,s)=>{\\"use strict\\";s.r(t),s.d(t,{default:()=>c});var a=s(7876),r=s(4232),n=s(9099),i=s(5176),l=s(7932),o=s(7685);function c(){let[e,t]=(0,r.useState)(\\"\\"),[s,c]=(0,r.useState)(\\"\\"),[d,u]=(0,r.useState)(!1),x=(0,n.useRouter)(),h=async t=>{t.preventDefault(),u(!0);try{await (0,i.x9)(l.j2,e,s),o.Ay.success(\\"Sesi\\\\xf3n iniciada correctamente\\"),x.push(\\"/admin/home\\")}catch(e){console.error(\\"Error de login:\\",e),o.Ay.error(\\"Credenciales incorrectas\\")}finally{u(!1)}};return(0,a.jsx)(\\"div\\",{className:\\"min-h-screen flex items-center justify-center bg-slate-950 px-4\\",children:(0,a.jsxs)(\\"div\\",{className:\\"max-w-md w-full space-y-8 bg-slate-900 p-10 rounded-3xl border border-slate-800 shadow-2xl\\",children:[(0,a.jsxs)(\\"div\\",{className:\\"text-center\\",children:[(0,a.jsx)(\\"h1\\",{className:\\"text-3xl font-black text-white tracking-tighter\\",children:\\"CRONOAPP\\"}),(0,a.jsx)(\\"p\\",{className:\\"mt-2 text-slate-400 text-sm\\",children:\\"Ingresa a tu centro de mando\\"})]}),(0,a.jsxs)(\\"form\\",{className:\\"mt-8 space-y-6\\",onSubmit:h,children:[(0,a.jsxs)(\\"div\\",{className:\\"space-y-4\\",children:[(0,a.jsx)(\\"input\\",{type:\\"email\\",required:!0,value:e,onChange:e=>t(e.target.value),className:\\"w-full px-5 py-4 bg-slate-800 border border-slate-700 text-white rounded-xl focus:ring-2 focus:ring-indigo-500 outline-none transition-all\\",placeholder:\\"Correo electr\\\\xf3nico\\"}),(0,a.jsx)(\\"input\\",{type:\\"password\\",required:!0,value:s,onChange:e=>c(e.target.value),className:\\"w-full px-5 py-4 bg-slate-800 border border-slate-700 text-white rounded-xl focus:ring-2 focus:ring-indigo-500 outline-none transition-all\\",placeholder:\\"Contrase\\\\xf1a\\"})]}),(0,a.jsx)(\\"button\\",{type:\\"submit\\",disabled:d,className:\\"w-full py-4 px-6 bg-indigo-600 hover:bg-indigo-500 text-white font-bold rounded-xl shadow-lg shadow-indigo-500/20 transition-all disabled:opacity-50\\",children:d?\\"Verificando...\\":\\"Iniciar Sesi\\\\xf3n\\"})]})]})})}},7984:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/login\\",function(){return s(6392)}])},9099:(e,t,s)=>{e.exports=s(9603)}},e=>{e.O(0,[636,593,792],()=>e(e.s=7984)),_N_E=e.O()}]);"},{"name":"_app-2f1586a37ad18c3a.js","path":"apps/web/out/_next/static/chunks/pages/_app-2f1586a37ad18c3a.js","area":"FRONTEND","folder":"PAGES","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{89:(e,t,r)=>{\\"use strict\\";r.d(t,{Q:()=>i});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},92:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/_app\\",function(){return r(5648)}])},388:(e,t,r)=>{\\"use strict\\";let i,n,s,a,o,l;r.d(t,{jG:()=>h});var u=r(8306).Zq,h=(i=[],n=0,s=e=>{e()},a=e=>{e()},o=u,{batch:e=>{let t;n++;try{t=e()}finally{let e;--n||(e=i,i=[],e.length&&o(()=>{a(()=>{e.forEach(e=>{s(e)})})}))}return t},batchCalls:e=>(...t)=>{l(()=>{e(...t)})},schedule:l=e=>{n?i.push(e):o(()=>{s(e)})},setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{a=e},setScheduler:e=>{o=e}})},485:(e,t,r)=>{\\"use strict\\";r.d(t,{Dc:()=>eg,rJ:()=>n2,H9:()=>n6,x7:()=>sR,GG:()=>sO,aU:()=>n7,P:()=>sy,_M:()=>sw});var i,n,s,a,o,l,u,h,c,d,f,p,g,m,y=r(6672),v=r(1610),w=r(9979),b=r(6653),_=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{},E={};(function(){function e(){this.blockSize=-1,this.blockSize=64,this.g=[,,,,],this.C=Array(this.blockSize),this.o=this.h=0,this.u()}var t=function(){this.blockSize=-1};function r(){}function s(e,t,r){r||(r=0);let i=Array(16);if(\\"string\\"==typeof t)for(var n=0;n<16;++n)i[n]=t.charCodeAt(r++)|t.charCodeAt(r++)<<8|t.charCodeAt(r++)<<16|t.charCodeAt(r++)<<24;else for(n=0;n<16;++n)i[n]=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;t=e.g[0],r=e.g[1],n=e.g[2];let s=e.g[3],a;a=t+(s^r&(n^s))+i[0]+0xd76aa478|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[1]+0xe8c7b756|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[2]+0x242070db|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[3]+0xc1bdceee|0,a=t+(s^(r=n+(a<<22|a>>>10))&(n^s))+i[4]+0xf57c0faf|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[5]+0x4787c62a|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[6]+0xa8304613|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[7]+0xfd469501|0,a=t+(s^(r=n+(a<<22|a>>>10))&(n^s))+i[8]+0x698098d8|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[9]+0x8b44f7af|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[10]+0xffff5bb1|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[11]+0x895cd7be|0,a=t+(s^(r=n+(a<<22|a>>>10))&(n^s))+i[12]+0x6b901122|0,a=s+(n^(t=r+(a<<7|a>>>25))&(r^n))+i[13]+0xfd987193|0,a=n+(r^(s=t+(a<<12|a>>>20))&(t^r))+i[14]+0xa679438e|0,a=r+(t^(n=s+(a<<17|a>>>15))&(s^t))+i[15]+0x49b40821|0,r=n+(a<<22|a>>>10),a=t+(n^s&(r^n))+i[1]+0xf61e2562|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[6]+0xc040b340|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[11]+0x265e5a51|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[0]+0xe9b6c7aa|0,r=n+(a<<20|a>>>12),a=t+(n^s&(r^n))+i[5]+0xd62f105d|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[10]+0x2441453|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[15]+0xd8a1e681|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[4]+0xe7d3fbc8|0,r=n+(a<<20|a>>>12),a=t+(n^s&(r^n))+i[9]+0x21e1cde6|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[14]+0xc33707d6|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[3]+0xf4d50d87|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[8]+0x455a14ed|0,r=n+(a<<20|a>>>12),a=t+(n^s&(r^n))+i[13]+0xa9e3e905|0,t=r+(a<<5|a>>>27),a=s+(r^n&(t^r))+i[2]+0xfcefa3f8|0,s=t+(a<<9|a>>>23),a=n+(t^r&(s^t))+i[7]+0x676f02d9|0,n=s+(a<<14|a>>>18),a=r+(s^t&(n^s))+i[12]+0x8d2a4c8a|0,a=t+((r=n+(a<<20|a>>>12))^n^s)+i[5]+0xfffa3942|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[8]+0x8771f681|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[11]+0x6d9d6122|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[14]+0xfde5380c|0,a=t+((r=n+(a<<23|a>>>9))^n^s)+i[1]+0xa4beea44|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[4]+0x4bdecfa9|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[7]+0xf6bb4b60|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[10]+0xbebfbc70|0,a=t+((r=n+(a<<23|a>>>9))^n^s)+i[13]+0x289b7ec6|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[0]+0xeaa127fa|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[3]+0xd4ef3085|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[6]+0x4881d05|0,a=t+((r=n+(a<<23|a>>>9))^n^s)+i[9]+0xd9d4d039|0,a=s+((t=r+(a<<4|a>>>28))^r^n)+i[12]+0xe6db99e5|0,a=n+((s=t+(a<<11|a>>>21))^t^r)+i[15]+0x1fa27cf8|0,a=r+((n=s+(a<<16|a>>>16))^s^t)+i[2]+0xc4ac5665|0,r=n+(a<<23|a>>>9),a=t+(n^(r|~s))+i[0]+0xf4292244|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[7]+0x432aff97|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[14]+0xab9423a7|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[5]+0xfc93a039|0,r=n+(a<<21|a>>>11),a=t+(n^(r|~s))+i[12]+0x655b59c3|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[3]+0x8f0ccc92|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[10]+0xffeff47d|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[1]+0x85845dd1|0,r=n+(a<<21|a>>>11),a=t+(n^(r|~s))+i[8]+0x6fa87e4f|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[15]+0xfe2ce6e0|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[6]+0xa3014314|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[13]+0x4e0811a1|0,r=n+(a<<21|a>>>11),a=t+(n^(r|~s))+i[4]+0xf7537e82|0,t=r+(a<<6|a>>>26),a=s+(r^(t|~n))+i[11]+0xbd3af235|0,s=t+(a<<10|a>>>22),a=n+(t^(s|~r))+i[2]+0x2ad7d2bb|0,n=s+(a<<15|a>>>17),a=r+(s^(n|~t))+i[9]+0xeb86d391|0,e.g[0]=e.g[0]+t|0,e.g[1]=e.g[1]+(n+(a<<21|a>>>11))|0,e.g[2]=e.g[2]+n|0,e.g[3]=e.g[3]+s|0}function a(e,t){this.h=t;let r=[],i=!0;for(let n=e.length-1;n>=0;n--){let s=0|e[n];i&&s==t||(r[n]=s,i=!1)}this.g=r}r.prototype=t.prototype,e.F=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.D=function(e,r,i){for(var n=Array(arguments.length-2),s=2;s>>i&255;return e};var o,l={};function u(e){var t;return -128<=e&&e<128?(t=function(e){return new a([0|e],e<0?-1:0)},Object.prototype.hasOwnProperty.call(l,e)?l[e]:l[e]=t(e)):new a([0|e],e<0?-1:0)}function h(e){if(isNaN(e)||!isFinite(e))return c;if(e<0)return m(h(-e));let t=[],r=1;for(let i=0;e>=r;i++)t[i]=e/r|0,r*=0x100000000;return new a(t,0)}var c=u(0),d=u(1),f=u(0x1000000);function p(e){if(0!=e.h)return!1;for(let t=0;t>>16,e[t]&=65535,t++}function w(e,t){this.g=e,this.h=t}function b(e,t){if(p(t))throw Error(\\"division by zero\\");if(p(e))return new w(c,c);if(g(e))return t=b(m(e),t),new w(m(t.g),m(t.h));if(g(t))return t=b(e,m(t)),new w(m(t.g),t.h);if(e.g.length>30){if(g(e)||g(t))throw Error(\\"slowDivide_ only works with positive integers.\\");for(var r=d,i=t;0>=i.l(e);)r=_(r),i=_(i);var n=I(r,1),s=I(i,1);for(i=I(i,2),r=I(r,2);!p(i);){var a=s.add(i);0>=a.l(e)&&(n=n.add(r),s=a),i=I(i,1),r=I(r,1)}return t=y(e,n.j(t)),new w(n,t)}for(n=c;e.l(t)>=0;){for(i=(i=Math.ceil(Math.log(r=Math.max(1,Math.floor(e.m()/t.m())))/Math.LN2))<=48?1:Math.pow(2,i-48),a=(s=h(r)).j(t);g(a)||a.l(e)>0;)r-=i,a=(s=h(r)).j(t);p(s)&&(s=d),n=n.add(s),e=y(e,a)}return new w(n,e)}function _(e){let t=e.g.length+1,r=[];for(let i=0;i>>31;return new a(r,e.h)}function I(e,t){let r=t>>5;t%=32;let i=e.g.length-r,n=[];for(let s=0;s0?e.i(s+r)>>>t|e.i(s+r+1)<<32-t:e.i(s+r);return new a(n,e.h)}(o=a.prototype).m=function(){if(g(this))return-m(this).m();let e=0,t=1;for(let r=0;r=0?i:0x100000000+i)*t,t*=0x100000000}return e},o.toString=function(e){if((e=e||10)<2||360?r.g[0]:r.h)>>>0).toString(e);if(p(r=n))return s+i;for(;s.length<6;)s=\\"0\\"+s;i=s+i}},o.i=function(e){return e<0?0:e>>16)+(this.i(n)>>>16)+(e.i(n)>>>16);i=s>>>16,t&=65535,s&=65535,r[n]=s<<16|t}return new a(r,-0x80000000&r[r.length-1]?-1:0)},o.j=function(e){if(p(this)||p(e))return c;if(g(this))return g(e)?m(this).j(m(e)):m(m(this).j(e));if(g(e))return m(this.j(m(e)));if(0>this.l(f)&&0>e.l(f))return h(this.m()*e.m());let t=this.g.length+e.g.length,r=[];for(var i=0;i<2*t;i++)r[i]=0;for(i=0;i>>16,s=65535&this.i(i),a=e.i(t)>>>16,o=65535&e.i(t);r[2*i+2*t]+=s*o,v(r,2*i+2*t),r[2*i+2*t+1]+=n*o,v(r,2*i+2*t+1),r[2*i+2*t+1]+=s*a,v(r,2*i+2*t+1),r[2*i+2*t+2]+=n*a,v(r,2*i+2*t+2)}for(e=0;e=0)throw Error(\'number format error: interior \\"-\\" character\');let i=h(Math.pow(r,8)),n=c;for(let e=0;ee&&AsyncContext.Snapshot.wrap(e):e=>e;function _(e){let t=e.length;if(t>0){let r=Array(t);for(let i=0;i0?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}class C{constructor(){this.h=this.g=null}add(e,t){let r=A.get();r.set(e,t),this.h?this.h.next=r:this.g=r,this.h=r}}var A=new S(()=>new k,e=>e.reset());class k{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let R,N=!1,O=new C,P=()=>{let e=Promise.resolve(void 0);R=()=>{e.then(D)}};function D(){let e;for(var t;e=null,O.g&&(e=O.g,O.g=O.g.next,O.g||(O.h=null),e.next=null),t=e;){try{t.h.call(t.g)}catch(e){!function(e){p.setTimeout(()=>{throw e},0)}(e)}A.j(t),A.h<100&&(A.h++,t.next=A.g,A.g=t)}N=!1}function x(){this.u=this.u,this.C=this.C}function L(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}x.prototype.u=!1,x.prototype.dispose=function(){this.u||(this.u=!0,this.N())},x.prototype[Symbol.dispose]=function(){this.dispose()},x.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},L.prototype.h=function(){this.defaultPrevented=!0};var M=function(){if(!p.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},\\"passive\\",{get:function(){e=!0}});try{let e=()=>{};p.addEventListener(\\"test\\",e,t),p.removeEventListener(\\"test\\",e,t)}catch(e){}return e}();function U(e){return/^[\\\\s\\\\xa0]*$/.test(e)}function F(e,t){L.call(this,e?e.type:\\"\\"),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key=\\"\\",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType=\\"\\",this.i=null,e&&this.init(e,t)}w(F,L),F.prototype.init=function(e,t){let r=this.type=e.type,i=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;this.target=e.target||e.srcElement,this.g=t,(t=e.relatedTarget)||(\\"mouseover\\"==r?t=e.fromElement:\\"mouseout\\"==r&&(t=e.toElement)),this.relatedTarget=t,i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||\\"\\",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=e.pointerType,this.state=e.state,this.i=e,e.defaultPrevented&&F.Z.h.call(this)},F.prototype.h=function(){F.Z.h.call(this);let e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var V=\\"closure_listenable_\\"+(1e6*Math.random()|0),j=0;function q(e,t,r,i,n){this.listener=e,this.proxy=null,this.src=t,this.type=r,this.capture=!!i,this.ha=n,this.key=++j,this.da=this.fa=!1}function B(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function $(e,t,r){for(let i in e)t.call(r,e[i],i,e)}function z(e){let t={};for(let r in e)t[r]=e[r];return t}let H=\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\".split(\\" \\");function K(e,t){let r,i;for(let t=1;t=0)&&Array.prototype.splice.call(n,s,1),i&&(B(t),0==e.g[r].length&&(delete e.g[r],e.h--))}}function W(e,t,r,i){for(let n=0;n-1?(t=e[a],r||(t.fa=!1)):((t=new q(t,this.src,s,!!i,n)).fa=r,e.push(t)),t};var J=\\"closure_lm_\\"+(1e6*Math.random()|0),X={};function Y(e,t,r,i,n,s){if(!t)throw Error(\\"Invalid event type\\");let a=g(n)?!!n.capture:!!n,o=er(e);if(o||(e[J]=o=new G(e)),(r=o.add(t,r,i,a,s)).proxy)return r;if(i=function e(t){return et.call(e.src,e.listener,t)},r.proxy=i,i.src=e,i.listener=r,e.addEventListener)M||(n=a),void 0===n&&(n=!1),e.addEventListener(t.toString(),i,n);else if(e.attachEvent)e.attachEvent(ee(t.toString()),i);else if(e.addListener&&e.removeListener)e.addListener(i);else throw Error(\\"addEventListener and attachEvent are unavailable.\\");return r}function Z(e){if(\\"number\\"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[V])Q(t.i,e);else{var r=e.type,i=e.proxy;t.removeEventListener?t.removeEventListener(r,i,e.capture):t.detachEvent?t.detachEvent(ee(r),i):t.addListener&&t.removeListener&&t.removeListener(i),(r=er(t))?(Q(r,e),0==r.h&&(r.src=null,t[J]=null)):B(e)}}}function ee(e){return e in X?X[e]:X[e]=\\"on\\"+e}function et(e,t){if(e.da)e=!0;else{t=new F(t,this);let r=e.listener,i=e.ha||e.src;e.fa&&Z(e),e=r.call(i,t)}return e}function er(e){return(e=e[J])instanceof G?e:null}var ei=\\"__closure_events_fn_\\"+(1e9*Math.random()>>>0);function en(e){return\\"function\\"==typeof e?e:(e[ei]||(e[ei]=function(t){return e.handleEvent(t)}),e[ei])}function es(){x.call(this),this.i=new G(this),this.M=this,this.G=null}function ea(e,t){let r,i;var n,s=e.G;if(s)for(n=[];s;s=s.G)n.push(s);if(e=e.M,s=t.type||t,\\"string\\"==typeof t)t=new L(t,e);else if(t instanceof L)t.target=t.target||e;else{var a=t;K(t=new L(s,e),a)}if(a=!0,n)for(i=n.length-1;i>=0;i--)a=eo(r=t.g=n[i],s,!0,t)&&a;if(a=eo(r=t.g=e,s,!0,t)&&a,a=eo(r,s,!1,t)&&a,n)for(i=0;i-1&&(B(r[i]),Array.prototype.splice.call(r,i,1),0==r.length&&(delete t.g[a],t.h--))):t&&(t=er(t))&&(r=t.g[r.toString()],t=-1,r&&(t=W(r,i,n,s)),(i=t>-1?r[t]:null)&&Z(i))}(this,e,t,r,i)},es.prototype.N=function(){if(es.Z.N.call(this),this.i){var e=this.i;for(let t in e.g){let r=e.g[t];for(let e=0;e0x7fffffff?-1:p.setTimeout(e,t||0)}(()=>{t.g=null,t.i&&(t.i=!1,e(t))},t.l);let r=t.h;t.h=null,t.m.apply(null,r)}(this)}N(){super.N(),this.g&&(p.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function eu(e){x.call(this),this.h=e,this.g={}}w(eu,x);var eh=[];function ec(e){$(e.g,function(e,t){this.g.hasOwnProperty(t)&&Z(e)},e),e.g={}}eu.prototype.N=function(){eu.Z.N.call(this),ec(this)},eu.prototype.handleEvent=function(){throw Error(\\"EventHandler.handleEvent not implemented\\")};var ed=p.JSON.stringify,ef=p.JSON.parse,ep=class{stringify(e){return p.JSON.stringify(e,void 0)}parse(e){return p.JSON.parse(e,void 0)}};function eg(){}function em(){}var ey={OPEN:\\"a\\",hb:\\"b\\",ERROR:\\"c\\",tb:\\"d\\"};function ev(){L.call(this,\\"d\\")}function ew(){L.call(this,\\"c\\")}w(ev,L),w(ew,L);var eb={},e_=null;function eE(){return e_=e_||new es}function eI(e){L.call(this,eb.Ia,e)}function eT(e){let t=eE();ea(t,new eI(t))}function eS(e,t){L.call(this,eb.STAT_EVENT,e),this.stat=t}function eC(e){let t=eE();ea(t,new eS(t,e))}function eA(e,t){L.call(this,eb.Ja,e),this.size=t}function ek(e,t){if(\\"function\\"!=typeof e)throw Error(\\"Fn must not be null and must be a function\\");return p.setTimeout(function(){e()},t)}function eR(){this.g=!0}function eN(e,t,r,i){e.info(function(){return\\"XMLHTTP TEXT (\\"+t+\\"): \\"+function(e,t){if(!e.g)return t;if(!t)return null;try{let s=JSON.parse(t);if(s){for(e=0;e0&&(e.O=new el(y(e.Y,e,e.g),e.P)),t=e.V,l=e.g,u=e.ba;var h=\\"readystatechange\\";Array.isArray(h)||(h&&(eh[0]=h.toString()),h=eh);for(let e=0;e1){let t=l[0];l=l[1];let r=t.split(\\"_\\");e=r.length>=2&&\\"type\\"==r[1]?e+(t+\\"=\\")+l+\\"&\\":e+(t+\\"=redacted&\\")}}}else e=null;else e=o;return\\"XMLHTTP REQ (\\"+s+\\") [attempt \\"+a+\\"]: \\"+i+\\"\\\\n\\"+n+\\"\\\\n\\"+e})}function eq(e){return!!e.g&&\\"GET\\"==e.v&&2!=e.M&&e.j.Aa}function eB(e){e.T=Date.now()+e.H,e$(e,e.H)}function e$(e,t){if(null!=e.D)throw Error(\\"WatchDog timer not null\\");e.D=ek(y(e.aa,e),t)}function ez(e){e.D&&(p.clearTimeout(e.D),e.D=null)}function eH(e){0==e.j.I||e.K||tQ(e.j,e)}function eK(e){ez(e);var t=e.O;t&&\\"function\\"==typeof t.dispose&&t.dispose(),e.O=null,ec(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dispose())}function eG(e,t){try{var r=e.j;if(0!=r.I&&(r.g==e||eY(r.h,e))){if(!e.L&&eY(r.h,e)&&3==r.I){try{var i=r.Ba.g.parse(t)}catch(e){i=null}if(Array.isArray(i)&&3==i.length){var n=i;if(0==n[0]){e:if(!r.v){if(r.g)if(r.g.F+3e3=eX(r.h)&&r.ta&&(r.ta=void 0)}else tJ(r,11)}else if((e.L||r.g==e)&&tG(r),!U(t))for(n=r.Ba.g.parse(t),t=0;t0&&(r.O=i=1.5*l,r.j.info(\\"backChannelRequestTimeoutMs_=\\"+i)),i=r;let u=e.g;if(u){let e=u.g?u.g.getResponseHeader(\\"X-Client-Wire-Protocol\\"):null;if(e){var s=i.h;s.g||-1==e.indexOf(\\"spdy\\")&&-1==e.indexOf(\\"quic\\")&&-1==e.indexOf(\\"h2\\")||(s.j=s.l,s.g=new Set,s.h&&(eZ(s,s.h),s.h=null))}if(i.G){let e=u.g?u.g.getResponseHeader(\\"X-HTTP-Session-Id\\"):null;e&&(i.wa=e,e7(i.J,i.G,e))}}if(r.I=3,r.l&&r.l.ra(),r.aa&&(r.T=Date.now()-e.F,r.j.info(\\"Handshake RTT: \\"+r.T+\\"ms\\")),(i=r).na=tY(i,i.L?i.ba:null,i.W),e.L){e0(i.h,e);var a=i.O;a&&(e.H=a),e.D&&(ez(e),eB(e)),i.g=e}else t$(i);r.i.length>0&&tV(r)}else\\"stop\\"!=o[0]&&\\"close\\"!=o[0]||tJ(r,7);else 3==r.I&&(\\"stop\\"==o[0]||\\"close\\"==o[0]?\\"stop\\"==o[0]?tJ(r,7):tM(r):\\"noop\\"!=o[0]&&r.l&&r.l.qa(o),r.A=0)}}eT(4)}catch(e){}}eL.prototype.ba=function(e){e=e.target;let t=this.O;t&&3==tP(e)?t.j():this.Y(e)},eL.prototype.Y=function(e){try{if(e==this.g)e:{let d=tP(this.g),f=this.g.ya(),g=this.g.ca();if(!(d<3)&&(3!=d||this.g&&(this.h.h||this.g.la()||tD(this.g)))){this.K||4!=d||7==f||(8==f||g<=0?eT(3):eT(2)),ez(this);var t=this.g.ca();this.X=t;var r=function(e){if(!eq(e))return e.g.la();let t=tD(e.g);if(\\"\\"===t)return\\"\\";let r=\\"\\",i=t.length,n=4==tP(e.g);if(!e.h.i){if(\\"undefined\\"==typeof TextDecoder)return eK(e),eH(e),\\"\\";e.h.i=new p.TextDecoder}for(let s=0;st.length?eF:(t=t.slice(i,i+r),e.C=i+r,t)}(this,r))==eF){4==d&&(this.m=4,eC(14),e=!1),eN(this.i,this.l,null,\\"[Incomplete Response]\\");break}else if(t==eU){this.m=4,eC(15),eN(this.i,this.l,r,\\"[Invalid Chunk]\\"),e=!1;break}else eN(this.i,this.l,t,null),eG(this,t);if(eq(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=d||0!=r.length||this.h.h||(this.m=1,eC(16),e=!1),this.o=this.o&&e,e){if(r.length>0&&!this.W){this.W=!0;var c=this.j;c.g==this&&c.aa&&!c.P&&(c.j.info(\\"Great, no buffering proxy detected. Bytes received: \\"+r.length),tH(c),c.P=!0,eC(11))}}else eN(this.i,this.l,r,\\"[Invalid Chunked Response]\\"),eK(this),eH(this)}else eN(this.i,this.l,r,null),eG(this,r);4==d&&eK(this),this.o&&!this.K&&(4==d?tQ(this.j,this):(this.o=!1,eB(this)))}else(function(e){let t={};e=(e.g&&tP(e)>=2&&e.g.getAllResponseHeaders()||\\"\\").split(\\"\\\\r\\\\n\\");for(let i=0;i0&&e.length;)r.push(e.shift()),t--;return e.length&&r.push(e.join(\\":\\")),r}(e[i]);let n=r[0];if(\\"string\\"!=typeof(r=r[1]))continue;r=r.trim();let s=t[n]||[];t[n]=s,s.push(r)}var i=function(e){return e.join(\\", \\")};for(let e in t)i.call(void 0,t[e],e,t)})(this.g),400==t&&r.indexOf(\\"Unknown SID\\")>0?(this.m=3,eC(12)):(this.m=0,eC(13)),eK(this),eH(this)}}}catch(e){}finally{}},eL.prototype.cancel=function(){this.K=!0,eK(this)},eL.prototype.aa=function(){var e,t;this.D=null;let r=Date.now();r-this.T>=0?(e=this.i,t=this.B,e.info(function(){return\\"TIMEOUT: \\"+t}),2!=this.M&&(eT(),eC(17)),eK(this),this.m=2,eH(this)):e$(this,this.T-r)};var eQ=class{constructor(e,t){this.g=e,this.map=t}};function eW(e){this.l=e||10,e=p.PerformanceNavigationTiming?(e=p.performance.getEntriesByType(\\"navigation\\")).length>0&&(\\"hq\\"==e[0].nextHopProtocol||\\"h2\\"==e[0].nextHopProtocol):!!(p.chrome&&p.chrome.loadTimes&&p.chrome.loadTimes()&&p.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function eJ(e){return!!e.h||!!e.g&&e.g.size>=e.j}function eX(e){return e.h?1:e.g?e.g.size:0}function eY(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function eZ(e,t){e.g?e.g.add(t):e.h=t}function e0(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function e1(e){if(null!=e.h)return e.i.concat(e.h.G);if(null!=e.g&&0!==e.g.size){let t=e.i;for(let r of e.g.values())t=t.concat(r.G);return t}return _(e.i)}eW.prototype.cancel=function(){if(this.i=e1(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(let e of this.g.values())e.cancel();this.g.clear()}};var e2=RegExp(\\"^(?:([^:/?#.]+):)?(?://(?:([^\\\\\\\\\\\\\\\\/?#]*)@)?([^\\\\\\\\\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\\\\\?([^#]*))?(?:#([\\\\\\\\s\\\\\\\\S]*))?$\\");function e6(e){let t;this.g=this.o=this.j=\\"\\",this.u=null,this.m=this.h=\\"\\",this.l=!1,e instanceof e6?(this.l=e.l,e5(this,e.j),this.o=e.o,this.g=e.g,e4(this,e.u),this.h=e.h,e8(this,tp(e.i)),this.m=e.m):e&&(t=String(e).match(e2))?(this.l=!1,e5(this,t[1]||\\"\\",!0),this.o=te(t[2]||\\"\\"),this.g=te(t[3]||\\"\\",!0),e4(this,t[4]),this.h=te(t[5]||\\"\\",!0),e8(this,t[6]||\\"\\",!0),this.m=te(t[7]||\\"\\")):(this.l=!1,this.i=new tl(null,this.l))}function e3(e){return new e6(e)}function e5(e,t,r){e.j=r?te(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,\\"\\"))}function e4(e,t){if(t){if(isNaN(t=Number(t))||t<0)throw Error(\\"Bad port number \\"+t);e.u=t}else e.u=null}function e8(e,t,r){var i,n;t instanceof tl?(e.i=t,i=e.i,(n=e.l)&&!i.j&&(tu(i),i.i=null,i.g.forEach(function(e,t){let r=t.toLowerCase();t!=r&&(th(this,t),tf(this,r,e))},i)),i.j=n):(r||(t=tt(t,ta)),e.i=new tl(t,e.l))}function e7(e,t,r){e.i.set(t,r)}function e9(e){return e7(e,\\"zx\\",Math.floor(0x80000000*Math.random()).toString(36)+Math.abs(Math.floor(0x80000000*Math.random())^Date.now()).toString(36)),e}function te(e,t){return e?t?decodeURI(e.replace(/%25/g,\\"%2525\\")):decodeURIComponent(e):\\"\\"}function tt(e,t,r){return\\"string\\"==typeof e?(e=encodeURI(e).replace(t,tr),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,\\"%$1\\")),e):null}function tr(e){return\\"%\\"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}e6.prototype.toString=function(){let e=[];var t=this.j;t&&e.push(tt(t,ti,!0),\\":\\");var r=this.g;return(r||\\"file\\"==t)&&(e.push(\\"//\\"),(t=this.o)&&e.push(tt(t,ti,!0),\\"@\\"),e.push(ex(r).replace(/%25([0-9a-fA-F]{2})/g,\\"%$1\\")),null!=(r=this.u)&&e.push(\\":\\",String(r))),(r=this.h)&&(this.g&&\\"/\\"!=r.charAt(0)&&e.push(\\"/\\"),e.push(tt(r,\\"/\\"==r.charAt(0)?ts:tn,!0))),(r=this.i.toString())&&e.push(\\"?\\",r),(r=this.m)&&e.push(\\"#\\",tt(r,to)),e.join(\\"\\")},e6.prototype.resolve=function(e){let t=e3(this),r=!!e.j;r?e5(t,e.j):r=!!e.o,r?t.o=e.o:r=!!e.g,r?t.g=e.g:r=null!=e.u;var i=e.h;if(r)e4(t,e.u);else if(r=!!e.h){if(\\"/\\"!=i.charAt(0))if(this.g&&!this.h)i=\\"/\\"+i;else{var n=t.h.lastIndexOf(\\"/\\");-1!=n&&(i=t.h.slice(0,n+1)+i)}if(\\"..\\"==(n=i)||\\".\\"==n)i=\\"\\";else if(-1!=n.indexOf(\\"./\\")||-1!=n.indexOf(\\"/.\\")){i=0==n.lastIndexOf(\\"/\\",0),n=n.split(\\"/\\");let e=[];for(let t=0;t1||1==e.length&&\\"\\"!=e[0])&&e.pop(),i&&t==n.length&&e.push(\\"\\")):(e.push(r),i=!0)}i=e.join(\\"/\\")}else i=n}return r?t.h=i:r=\\"\\"!==e.i.toString(),r?e8(t,tp(e.i)):r=!!e.m,r&&(t.m=e.m),t};var ti=/[#\\\\/\\\\?@]/g,tn=/[#\\\\?:]/g,ts=/[#\\\\?]/g,ta=/[#\\\\?@]/g,to=/#/g;function tl(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function tu(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split(\\"&\\");for(let r=0;r=0?(n=e[r].substring(0,i),s=e[r].substring(i+1)):n=e[r],t(n,s?decodeURIComponent(s.replace(/\\\\+/g,\\" \\")):\\"\\")}}}(e.i,function(t,r){e.add(decodeURIComponent(t.replace(/\\\\+/g,\\" \\")),r)}))}function th(e,t){tu(e),t=tg(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function tc(e,t){return tu(e),t=tg(e,t),e.g.has(t)}function td(e,t){tu(e);let r=[];if(\\"string\\"==typeof t)tc(e,t)&&(r=r.concat(e.g.get(tg(e,t))));else for(e=Array.from(e.g.values()),t=0;t0&&(e.i=null,e.g.set(tg(e,t),_(r)),e.h+=r.length)}function tp(e){let t=new tl;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function tg(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function tm(e,t,r,i,n){try{n&&(n.onload=null,n.onerror=null,n.onabort=null,n.ontimeout=null),i(r)}catch(e){}}function ty(){this.g=new ep}function tv(e){this.i=e.Sb||null,this.h=e.ab||!1}function tw(e,t){es.call(this),this.H=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText=\\"\\",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F=\\"GET\\",this.D=\\"\\",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function tb(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function t_(e){e.readyState=4,e.l=null,e.j=null,e.B=null,tE(e)}function tE(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function tI(e){let t=\\"\\";return $(e,function(e,r){t+=r,t+=\\":\\",t+=e,t+=\\"\\\\r\\\\n\\"}),t}function tT(e,t,r){e:{for(i in r){var i=!1;break e}i=!0}i||(r=tI(r),\\"string\\"==typeof e?null!=r&&ex(r):e7(e,t,r))}function tS(e){es.call(this),this.headers=new Map,this.L=e||null,this.h=!1,this.g=null,this.D=\\"\\",this.o=0,this.l=\\"\\",this.j=this.B=this.v=this.A=!1,this.m=null,this.F=\\"\\",this.H=!1}(t=tl.prototype).add=function(e,t){tu(this),this.i=null,e=tg(this,e);let r=this.g.get(e);return r||this.g.set(e,r=[]),r.push(t),this.h+=1,this},t.forEach=function(e,t){tu(this),this.g.forEach(function(r,i){r.forEach(function(r){e.call(t,r,i,this)},this)},this)},t.set=function(e,t){return tu(this),this.i=null,tc(this,e=tg(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},t.get=function(e,t){return e&&(e=td(this,e)).length>0?String(e[0]):t},t.toString=function(){if(this.i)return this.i;if(!this.g)return\\"\\";let e=[],t=Array.from(this.g.keys());for(let i=0;i{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,t_(this)),this.readyState=0},t.Pa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,tE(this)),this.g&&(this.readyState=3,tE(this),this.g)))if(\\"arraybuffer\\"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==p.ReadableStream&&\\"body\\"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error(\'responseType must be empty for \\"streamBinaryChunks\\" mode responses.\');this.response=[]}else this.response=this.responseText=\\"\\",this.B=new TextDecoder;tb(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))},t.Ma=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.B.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?t_(this):tE(this),3==this.readyState&&tb(this)}},t.Oa=function(e){this.g&&(this.response=this.responseText=e,t_(this))},t.Na=function(e){this.g&&(this.response=e,t_(this))},t.ga=function(){this.g&&t_(this)},t.setRequestHeader=function(e,t){this.A.append(e,t)},t.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||\\"\\"},t.getAllResponseHeaders=function(){if(!this.h)return\\"\\";let e=[],t=this.h.entries();for(var r=t.next();!r.done;)e.push((r=r.value)[0]+\\": \\"+r[1]),r=t.next();return e.join(\\"\\\\r\\\\n\\")},Object.defineProperty(tw.prototype,\\"withCredentials\\",{get:function(){return\\"include\\"===this.m},set:function(e){this.m=e?\\"include\\":\\"same-origin\\"}}),w(tS,es);var tC=/^https?$/i,tA=[\\"POST\\",\\"PUT\\"];function tk(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,tR(e),tO(e)}function tR(e){e.A||(e.A=!0,ea(e,\\"complete\\"),ea(e,\\"error\\"))}function tN(e){if(e.h&&void 0!==f){if(e.v&&4==tP(e))setTimeout(e.Ca.bind(e),0);else if(ea(e,\\"readystatechange\\"),4==tP(e)){e.h=!1;try{let s=e.ca();switch(s){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t,r,i=!0;break;default:i=!1}if(!(t=i)){if(r=0===s){let t=String(e.D).match(e2)[1]||null;!t&&p.self&&p.self.location&&(t=p.self.location.protocol.slice(0,-1)),r=!tC.test(t?t.toLowerCase():\\"\\")}t=r}if(t)ea(e,\\"complete\\"),ea(e,\\"success\\");else{e.o=6;try{var n=tP(e)>2?e.g.statusText:\\"\\"}catch(e){n=\\"\\"}e.l=n+\\" [\\"+e.ca()+\\"]\\",tR(e)}}finally{tO(e)}}}}function tO(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);let r=e.g;e.g=null,t||ea(e,\\"ready\\");try{r.onreadystatechange=null}catch(e){}}}function tP(e){return e.g?e.g.readyState:0}function tD(e){try{if(!e.g)return null;if(\\"response\\"in e.g)return e.g.response;switch(e.F){case\\"\\":case\\"text\\":return e.g.responseText;case\\"arraybuffer\\":if(\\"mozResponseArrayBuffer\\"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function tx(e,t,r){return r&&r.internalChannelParams&&r.internalChannelParams[e]||t}function tL(e){this.za=0,this.i=[],this.j=new eR,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=tx(\\"failFast\\",!1,e),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=tx(\\"baseRetryDelayMs\\",5e3,e),this.Za=tx(\\"retryDelaySeedMs\\",1e4,e),this.Ta=tx(\\"forwardChannelMaxRetries\\",2,e),this.va=tx(\\"forwardChannelRequestTimeoutMs\\",2e4,e),this.ma=e&&e.xmlHttpFactory||void 0,this.Ua=e&&e.Rb||void 0,this.Aa=e&&e.useFetchStreams||!1,this.O=void 0,this.L=e&&e.supportsCrossDomainXhr||!1,this.M=\\"\\",this.h=new eW(e&&e.concurrentRequestLimit),this.Ba=new ty,this.S=e&&e.fastHandshake||!1,this.R=e&&e.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=e&&e.Pb||!1,e&&e.ua&&this.j.ua(),e&&e.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&e&&e.detectBufferingProxy||!1,this.ia=void 0,e&&e.longPollingTimeout&&e.longPollingTimeout>0&&(this.ia=e.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function tM(e){if(tF(e),3==e.I){var t=e.V++,r=e3(e.J);if(e7(r,\\"SID\\",e.M),e7(r,\\"RID\\",t),e7(r,\\"TYPE\\",\\"terminate\\"),tq(e,r),(t=new eL(e,e.j,t)).M=2,t.A=e9(e3(r)),r=!1,p.navigator&&p.navigator.sendBeacon)try{r=p.navigator.sendBeacon(t.A.toString(),\\"\\")}catch(e){}!r&&p.Image&&((new Image).src=t.A,r=!0),r||(t.g=tZ(t.j,null),t.g.ea(t.A)),t.F=Date.now(),eB(t)}tX(e)}function tU(e){e.g&&(tH(e),e.g.cancel(),e.g=null)}function tF(e){tU(e),e.v&&(p.clearTimeout(e.v),e.v=null),tG(e),e.h.cancel(),e.m&&(\\"number\\"==typeof e.m&&p.clearTimeout(e.m),e.m=null)}function tV(e){if(!eJ(e.h)&&!e.m){e.m=!0;var t=e.Ea;R||P(),N||(R(),N=!0),O.add(t,e),e.D=0}}function tj(e,t){var r;r=t?t.l:e.V++;let i=e3(e.J);e7(i,\\"SID\\",e.M),e7(i,\\"RID\\",r),e7(i,\\"AID\\",e.K),tq(e,i),e.u&&e.o&&tT(i,e.u,e.o),r=new eL(e,e.j,r,e.D+1),null===e.u&&(r.J=e.o),t&&(e.i=t.G.concat(e.i)),t=tB(e,r,1e3),r.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),eZ(e.h,r),eV(r,i,t)}function tq(e,t){e.H&&$(e.H,function(e,r){e7(t,r,e)}),e.l&&$({},function(e,r){e7(t,r,e)})}function tB(e,t,r){r=Math.min(e.i.length,r);let i=e.l?y(e.l.Ka,e.l,e):null;e:{var n=e.i;let t=-1;for(;;){let e=[\\"count=\\"+r];-1==t?r>0?(t=n[0].g,e.push(\\"ofs=\\"+t)):t=0:e.push(\\"ofs=\\"+t);let o=!0;for(let l=0;l=3)&&(e.Y++,e.v=ek(y(e.Da,e),tW(e,e.A)),e.A++,!0)}function tH(e){null!=e.B&&(p.clearTimeout(e.B),e.B=null)}function tK(e){e.g=new eL(e,e.j,\\"rpc\\",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=e3(e.na);e7(t,\\"RID\\",\\"rpc\\"),e7(t,\\"SID\\",e.M),e7(t,\\"AID\\",e.K),e7(t,\\"CI\\",e.F?\\"0\\":\\"1\\"),!e.F&&e.ia&&e7(t,\\"TO\\",e.ia),e7(t,\\"TYPE\\",\\"xmlhttp\\"),tq(e,t),e.u&&e.o&&tT(t,e.u,e.o),e.O&&(e.g.H=e.O);var r=e.g;e=e.ba,r.M=1,r.A=e9(e3(t)),r.u=null,r.R=!0,ej(r,e)}function tG(e){null!=e.C&&(p.clearTimeout(e.C),e.C=null)}function tQ(e,t){var r,i=null;if(e.g==t){tG(e),tH(e),e.g=null;var n=2}else{if(!eY(e.h,t))return;i=t.G,e0(e.h,t),n=1}if(0!=e.I){if(t.o)if(1==n){i=t.u?t.u.length:0,t=Date.now()-t.F;var s=e.D;ea(n=eE(),new eA(n,i)),tV(e)}else t$(e);else if(3==(s=t.m)||0==s&&t.X>0||!(1==n&&(r=t,!(eX(e.h)>=e.h.j-!!e.m)&&(e.m?(e.i=r.G.concat(e.i),!0):1!=e.I&&2!=e.I&&!(e.D>=(e.Sa?0:e.Ta))&&(e.m=ek(y(e.Ea,e,r),tW(e,e.D)),e.D++,!0)))||2==n&&tz(e)))switch(i&&i.length>0&&((t=e.h).i=t.i.concat(i)),s){case 1:tJ(e,5);break;case 4:tJ(e,10);break;case 3:tJ(e,6);break;default:tJ(e,2)}}}function tW(e,t){let r=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(r*=2),r*t}function tJ(e,t){if(e.j.info(\\"Error code \\"+t),2==t){let t,s,a;var r,i=y(e.bb,e),n=e.Ua;let o=!n;n=new e6(n||\\"//www.google.com/images/cleardot.gif\\"),p.location&&\\"http\\"==p.location.protocol||e5(n,\\"https\\"),e9(n),o?function(e,t){let r=new eR;if(p.Image){let i=new Image;i.onload=v(tm,r,\\"TestLoadImage: loaded\\",!0,t,i),i.onerror=v(tm,r,\\"TestLoadImage: error\\",!1,t,i),i.onabort=v(tm,r,\\"TestLoadImage: abort\\",!1,t,i),i.ontimeout=v(tm,r,\\"TestLoadImage: timeout\\",!1,t,i),p.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=e}else t(!1)}(n.toString(),i):(r=n.toString(),t=new eR,s=new AbortController,a=setTimeout(()=>{s.abort(),tm(t,\\"TestPingServer: timeout\\",!1,i)},1e4),fetch(r,{signal:s.signal}).then(e=>{clearTimeout(a),e.ok?tm(t,\\"TestPingServer: ok\\",!0,i):tm(t,\\"TestPingServer: server error\\",!1,i)}).catch(()=>{clearTimeout(a),tm(t,\\"TestPingServer: error\\",!1,i)}))}else eC(2);e.I=0,e.l&&e.l.pa(t),tX(e),tF(e)}function tX(e){if(e.I=0,e.ja=[],e.l){let t=e1(e.h);(0!=t.length||0!=e.i.length)&&(E(e.ja,t),E(e.ja,e.i),e.h.i.length=0,_(e.i),e.i.length=0),e.l.oa()}}function tY(e,t,r){var i=r instanceof e6?e3(r):new e6(r);if(\\"\\"!=i.g)t&&(i.g=t+\\".\\"+i.g),e4(i,i.u);else{var n=p.location;i=n.protocol,t=t?t+\\".\\"+n.hostname:n.hostname,n=+n.port;let e=new e6(null);i&&e5(e,i),t&&(e.g=t),n&&e4(e,n),r&&(e.h=r),i=e}return r=e.G,t=e.wa,r&&t&&e7(i,r,t),e7(i,\\"VER\\",e.ka),tq(e,i),i}function tZ(e,t,r){if(t&&!e.L)throw Error(\\"Can\'t create secondary domain capable XhrIo object.\\");return(t=new tS(e.Aa&&!e.ma?new tv({ab:r}):e.ma)).Fa(e.L),t}function t0(){}function t1(){}function t2(e,t){es.call(this),this.g=new tL(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e[\\"X-Client-Protocol\\"]=\\"webchannel\\":e={\\"X-Client-Protocol\\":\\"webchannel\\"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e[\\"X-WebChannel-Content-Type\\"]=t.messageContentType:e={\\"X-WebChannel-Content-Type\\":t.messageContentType}),t&&t.sa&&(e?e[\\"X-WebChannel-Client-Profile\\"]=t.sa:e={\\"X-WebChannel-Client-Profile\\":t.sa}),this.g.U=e,(e=t&&t.Qb)&&!U(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!U(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new t5(this)}function t6(e){ev.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(let r in t){e=r;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function t3(){ew.call(this),this.status=1}function t5(e){this.g=e}(t=tS.prototype).Fa=function(e){this.H=e},t.ea=function(t,r,i,n){if(this.g)throw Error(\\"[goog.net.XhrIo] Object is active with another request=\\"+this.D+\\"; newUri=\\"+t);r=r?r.toUpperCase():\\"GET\\",this.D=t,this.l=\\"\\",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():e.g(),this.g.onreadystatechange=b(y(this.Ca,this));try{this.B=!0,this.g.open(r,String(t),!0),this.B=!1}catch(e){tk(this,e);return}if(t=i||\\"\\",i=new Map(this.headers),n)if(Object.getPrototypeOf(n)===Object.prototype)for(var s in n)i.set(s,n[s]);else if(\\"function\\"==typeof n.keys&&\\"function\\"==typeof n.get)for(let e of n.keys())i.set(e,n.get(e));else throw Error(\\"Unknown input type for opt_headers: \\"+String(n));for(let[e,a]of(n=Array.from(i.keys()).find(e=>\\"content-type\\"==e.toLowerCase()),s=p.FormData&&t instanceof p.FormData,!(Array.prototype.indexOf.call(tA,r,void 0)>=0)||n||s||i.set(\\"Content-Type\\",\\"application/x-www-form-urlencoded;charset=utf-8\\"),i))this.g.setRequestHeader(e,a);this.F&&(this.g.responseType=this.F),\\"withCredentials\\"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(t),this.v=!1}catch(e){tk(this,e)}},t.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,ea(this,\\"complete\\"),ea(this,\\"abort\\"),tO(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),tO(this,!0)),tS.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?tN(this):this.Xa())},t.Xa=function(){tN(this)},t.isActive=function(){return!!this.g},t.ca=function(){try{return tP(this)>2?this.g.status:-1}catch(e){return -1}},t.la=function(){try{return this.g?this.g.responseText:\\"\\"}catch(e){return\\"\\"}},t.La=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),ef(t)}},t.ya=function(){return this.o},t.Ha=function(){return\\"string\\"==typeof this.l?this.l:String(this.l)},(t=tL.prototype).ka=8,t.I=1,t.connect=function(e,t,r,i){eC(0),this.W=e,this.H=t||{},r&&void 0!==i&&(this.H.OSID=r,this.H.OAID=i),this.F=this.X,this.J=tY(this,null,this.W),tV(this)},t.Ea=function(e){if(this.m)if(this.m=null,1==this.I){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;let n=new eL(this,this.j,e),s=this.o;if(this.U&&(s?K(s=z(s),this.U):s=this.U),null!==this.u||this.R||(n.J=s,s=null),this.S)e:{for(var t=0,r=0;r4096){t=r;break e}if(4096===t||r===this.i.length-1){t=r+1;break e}}t=1e3}else t=1e3;t=tB(this,n,t),e7(r=e3(this.J),\\"RID\\",e),e7(r,\\"CVER\\",22),this.G&&e7(r,\\"X-HTTP-Session-Id\\",this.G),tq(this,r),s&&(this.R?t=\\"headers=\\"+ex(tI(s))+\\"&\\"+t:this.u&&tT(r,this.u,s)),eZ(this.h,n),this.Ra&&e7(r,\\"TYPE\\",\\"init\\"),this.S?(e7(r,\\"$req\\",t),e7(r,\\"SID\\",\\"null\\"),n.U=!0,eV(n,r,null)):eV(n,r,t),this.I=2}}else 3==this.I&&(e?tj(this,e):0==this.i.length||eJ(this.h)||tj(this))},t.Da=function(){if(this.v=null,tK(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var e=4*this.T;this.j.info(\\"BP detection timer enabled: \\"+e),this.B=ek(y(this.Wa,this),e)}},t.Wa=function(){this.B&&(this.B=null,this.j.info(\\"BP detection timeout reached.\\"),this.j.info(\\"Buffering proxy detected and switch to long-polling!\\"),this.F=!1,this.P=!0,eC(10),tU(this),tK(this))},t.Va=function(){null!=this.C&&(this.C=null,tU(this),tz(this),eC(19))},t.bb=function(e){e?(this.j.info(\\"Successfully pinged google.com\\"),eC(2)):(this.j.info(\\"Failed to ping google.com\\"),eC(1))},t.isActive=function(){return!!this.l&&this.l.isActive(this)},(t=t0.prototype).ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){},t1.prototype.g=function(e,t){return new t2(e,t)},w(t2,es),t2.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},t2.prototype.close=function(){tM(this.g)},t2.prototype.o=function(e){var t=this.g;if(\\"string\\"==typeof e){var r={};r.__data__=e,e=r}else this.v&&((r={}).__data__=ed(e),e=r);t.i.push(new eQ(t.Ya++,e)),3==t.I&&tV(t)},t2.prototype.N=function(){this.g.l=null,delete this.j,tM(this.g),delete this.g,t2.Z.N.call(this)},w(t6,ev),w(t3,ew),w(t5,t0),t5.prototype.ra=function(){ea(this.g,\\"a\\")},t5.prototype.qa=function(e){ea(this.g,new t6(e))},t5.prototype.pa=function(e){ea(this.g,new t3)},t5.prototype.oa=function(){ea(this.g,\\"b\\")},t1.prototype.createWebChannel=t1.prototype.g,t2.prototype.send=t2.prototype.o,t2.prototype.open=t2.prototype.m,t2.prototype.close=t2.prototype.close,d=T.createWebChannelTransport=function(){return new t1},c=T.getStatEventTarget=function(){return eE()},h=T.Event=eb,u=T.Stat={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},eO.NO_ERROR=0,eO.TIMEOUT=8,eO.HTTP_ERROR=6,l=T.ErrorCode=eO,eP.COMPLETE=\\"complete\\",o=T.EventType=eP,em.EventType=ey,ey.OPEN=\\"a\\",ey.CLOSE=\\"b\\",ey.ERROR=\\"c\\",ey.MESSAGE=\\"d\\",es.prototype.listen=es.prototype.J,a=T.WebChannel=em,T.FetchXmlHttpFactory=tv,tS.prototype.listenOnce=tS.prototype.K,tS.prototype.getLastError=tS.prototype.Ha,tS.prototype.getLastErrorCode=tS.prototype.ya,tS.prototype.getStatus=tS.prototype.ca,tS.prototype.getResponseJson=tS.prototype.La,tS.prototype.getResponseText=tS.prototype.la,tS.prototype.send=tS.prototype.ea,tS.prototype.setWithCredentials=tS.prototype.Fa,s=T.XhrIo=tS}).apply(void 0!==I?I:\\"undefined\\"!=typeof self?self:\\"undefined\\"!=typeof window?window:{}),r(5364);var S=r(8220).Buffer;let C=\\"@firebase/firestore\\",A=\\"4.9.3\\";class k{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?\\"uid:\\"+this.uid:\\"anonymous-user\\"}isEqual(e){return e.uid===this.uid}}k.UNAUTHENTICATED=new k(null),k.GOOGLE_CREDENTIALS=new k(\\"google-credentials-uid\\"),k.FIRST_PARTY=new k(\\"first-party-uid\\"),k.MOCK_USER=new k(\\"mock-user\\");let R=\\"12.7.0\\",N=new w.Vy(\\"@firebase/firestore\\");function O(){return N.logLevel}function P(e,...t){if(N.logLevel<=w.$b.DEBUG){let r=t.map(L);N.debug(`Firestore (${R}): ${e}`,...r)}}function D(e,...t){if(N.logLevel<=w.$b.ERROR){let r=t.map(L);N.error(`Firestore (${R}): ${e}`,...r)}}function x(e,...t){if(N.logLevel<=w.$b.WARN){let r=t.map(L);N.warn(`Firestore (${R}): ${e}`,...r)}}function L(e){if(\\"string\\"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}function M(e,t,r){let i=\\"Unexpected state\\";\\"string\\"==typeof t?i=t:r=t,U(e,i,r)}function U(e,t,r){let i=`FIRESTORE (${R}) INTERNAL ASSERTION FAILED: ${t} (ID: ${e.toString(16)})`;if(void 0!==r)try{i+=\\" CONTEXT: \\"+JSON.stringify(r)}catch(e){i+=\\" CONTEXT: \\"+r}throw D(i),Error(i)}function F(e,t,r,i){let n=\\"Unexpected state\\";\\"string\\"==typeof r?n=r:i=r,e||U(t,n,i)}let V={OK:\\"ok\\",CANCELLED:\\"cancelled\\",UNKNOWN:\\"unknown\\",INVALID_ARGUMENT:\\"invalid-argument\\",DEADLINE_EXCEEDED:\\"deadline-exceeded\\",NOT_FOUND:\\"not-found\\",ALREADY_EXISTS:\\"already-exists\\",PERMISSION_DENIED:\\"permission-denied\\",UNAUTHENTICATED:\\"unauthenticated\\",RESOURCE_EXHAUSTED:\\"resource-exhausted\\",FAILED_PRECONDITION:\\"failed-precondition\\",ABORTED:\\"aborted\\",OUT_OF_RANGE:\\"out-of-range\\",UNIMPLEMENTED:\\"unimplemented\\",INTERNAL:\\"internal\\",UNAVAILABLE:\\"unavailable\\",DATA_LOSS:\\"data-loss\\"};class j extends b.g{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class q{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class B{constructor(e,t){this.user=t,this.type=\\"OAuth\\",this.headers=new Map,this.headers.set(\\"Authorization\\",`Bearer ${e}`)}}class ${getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(k.UNAUTHENTICATED))}shutdown(){}}class z{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class H{constructor(e){this.t=e,this.currentUser=k.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){F(void 0===this.o,42304);let r=this.i,i=e=>this.i!==r?(r=this.i,t(e)):Promise.resolve(),n=new q;this.o=()=>{this.i++,this.currentUser=this.u(),n.resolve(),n=new q,e.enqueueRetryable(()=>i(this.currentUser))};let s=()=>{let t=n;e.enqueueRetryable(async()=>{await t.promise,await i(this.currentUser)})},a=e=>{P(\\"FirebaseAuthCredentialsProvider\\",\\"Auth detected\\"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){let e=this.t.getImmediate({optional:!0});e?a(e):(P(\\"FirebaseAuthCredentialsProvider\\",\\"Auth not yet detected\\"),n.resolve(),n=new q)}},0),s()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(P(\\"FirebaseAuthCredentialsProvider\\",\\"getToken aborted due to token change.\\"),this.getToken()):t?(F(\\"string\\"==typeof t.accessToken,31837,{l:t}),new B(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){let e=this.auth&&this.auth.getUid();return F(null===e||\\"string\\"==typeof e,2055,{h:e}),new k(e)}}class K{constructor(e,t,r){this.P=e,this.T=t,this.I=r,this.type=\\"FirstParty\\",this.user=k.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set(\\"X-Goog-AuthUser\\",this.P);let e=this.R();return e&&this.A.set(\\"Authorization\\",e),this.T&&this.A.set(\\"X-Goog-Iam-Authorization-Token\\",this.T),this.A}}class G{constructor(e,t,r){this.P=e,this.T=t,this.I=r}getToken(){return Promise.resolve(new K(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(k.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Q{constructor(e){this.value=e,this.type=\\"AppCheck\\",this.headers=new Map,e&&e.length>0&&this.headers.set(\\"x-firebase-appcheck\\",this.value)}}class W{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,(0,y.xZ)(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){F(void 0===this.o,3512);let r=e=>{null!=e.error&&P(\\"FirebaseAppCheckTokenProvider\\",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);let r=e.token!==this.m;return this.m=e.token,P(\\"FirebaseAppCheckTokenProvider\\",`Received ${r?\\"new\\":\\"existing\\"} token.`),r?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>r(t))};let i=e=>{P(\\"FirebaseAppCheckTokenProvider\\",\\"AppCheck detected\\"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>i(e)),setTimeout(()=>{if(!this.appCheck){let e=this.V.getImmediate({optional:!0});e?i(e):P(\\"FirebaseAppCheckTokenProvider\\",\\"AppCheck not yet detected\\")}},0)}getToken(){if(this.p)return Promise.resolve(new Q(this.p));let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(F(\\"string\\"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new Q(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}class J{static newId(){let e=62*Math.floor(256/62),t=\\"\\";for(;t.length<20;){let r=function(e){let t=\\"undefined\\"!=typeof self&&(self.crypto||self.msCrypto),r=new Uint8Array(40);if(t&&\\"function\\"==typeof t.getRandomValues)t.getRandomValues(r);else for(let e=0;e<40;e++)r[e]=Math.floor(256*Math.random());return r}(0);for(let i=0;it)}function Y(e,t){let r=Math.min(e.length,t.length);for(let i=0;i=55296&&t<=57343}function ee(e,t,r){return e.length===t.length&&e.every((e,i)=>r(e,t[i]))}let et=\\"__name__\\";class er{constructor(e,t,r){void 0===t?t=0:t>e.length&&M(637,{offset:t,range:e.length}),void 0===r?r=e.length-t:r>e.length-t&&M(1746,{length:r,range:e.length-t}),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return 0===er.comparator(this,e)}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof er?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length=0)throw new j(V.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split(\\"/\\").filter(e=>e.length>0))}return new ei(t)}static emptyPath(){return new ei([])}}let en=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class es extends er{construct(e,t,r){return new es(e,t,r)}static isValidIdentifier(e){return en.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\\\\\\\/g,\\"\\\\\\\\\\\\\\\\\\").replace(/`/g,\\"\\\\\\\\`\\"),es.isValidIdentifier(e)||(e=\\"`\\"+e+\\"`\\"),e)).join(\\".\\")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===et}static keyField(){return new es([et])}static fromServerFormat(e){let t=[],r=\\"\\",i=0,n=()=>{if(0===r.length)throw new j(V.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with \'.\', end with \'.\', or contain \'..\'`);t.push(r),r=\\"\\"},s=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===ei.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return ei.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ea(new ei(e.slice()))}}function eo(e,t,r){if(!r)throw new j(V.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function el(e){if(!ea.isDocumentKey(e))throw new j(V.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function eu(e){if(ea.isDocumentKey(e))throw new j(V.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function eh(e){return\\"object\\"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function ec(e){if(void 0===e)return\\"undefined\\";if(null===e)return\\"null\\";if(\\"string\\"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(\\"number\\"==typeof e||\\"boolean\\"==typeof e)return\\"\\"+e;if(\\"object\\"==typeof e){if(e instanceof Array)return\\"an array\\";{var t;let r=(t=e).constructor?t.constructor.name:null;return r?`a custom ${r} object`:\\"an object\\"}}return\\"function\\"==typeof e?\\"a function\\":M(12329,{type:typeof e})}function ed(e,t){if(\\"_delegate\\"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new j(V.INVALID_ARGUMENT,\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\");{let r=ec(e);throw new j(V.INVALID_ARGUMENT,`Expected type \'${t.name}\', but it was: ${r}`)}}return e}function ef(e,t){let r={typeString:e};return t&&(r.value=t),r}function ep(e,t){let r;if(!eh(e))throw new j(V.INVALID_ARGUMENT,\\"JSON must be an object\\");for(let i in t)if(t[i]){let n=t[i].typeString,s=\\"value\\"in t[i]?{value:t[i].value}:void 0;if(!(i in e)){r=`JSON missing required field: \'${i}\'`;break}let a=e[i];if(n&&typeof a!==n){r=`JSON field \'${i}\' must be a ${n}.`;break}if(void 0!==s&&a!==s.value){r=`Expected \'${i}\' field to equal \'${s.value}\'`;break}}if(r)throw new j(V.INVALID_ARGUMENT,r);return!0}class eg{static now(){return eg.fromMillis(Date.now())}static fromDate(e){return eg.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),r=Math.floor((e-1e3*t)*1e6);return new eg(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0||t>=1e9)throw new j(V.INVALID_ARGUMENT,\\"Timestamp nanoseconds out of range: \\"+t);if(e<-0xe7791f700||e>=0x3afff44180)throw new j(V.INVALID_ARGUMENT,\\"Timestamp seconds out of range: \\"+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?X(this.nanoseconds,e.nanoseconds):X(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return\\"Timestamp(seconds=\\"+this.seconds+\\", nanoseconds=\\"+this.nanoseconds+\\")\\"}toJSON(){return{type:eg._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(ep(e,eg._jsonSchema))return new eg(e.seconds,e.nanoseconds)}valueOf(){return String(this.seconds- -0xe7791f700).padStart(12,\\"0\\")+\\".\\"+String(this.nanoseconds).padStart(9,\\"0\\")}}eg._jsonSchemaVersion=\\"firestore/timestamp/1.0\\",eg._jsonSchema={type:ef(\\"string\\",eg._jsonSchemaVersion),seconds:ef(\\"number\\"),nanoseconds:ef(\\"number\\")};class em{static fromTimestamp(e){return new em(e)}static min(){return new em(new eg(0,0))}static max(){return new em(new eg(0x3afff4417f,0x3b9ac9ff))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return\\"SnapshotVersion(\\"+this.timestamp.toString()+\\")\\"}toTimestamp(){return this.timestamp}}class ey{constructor(e,t,r,i){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=i}}ey.UNKNOWN_ID=-1;class ev{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new ev(em.min(),ea.empty(),-1)}static max(){return new ev(em.max(),ea.empty(),-1)}}class ew{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function eb(e){if(e.code!==V.FAILED_PRECONDITION||\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\"!==e.message)throw e;P(\\"LocalStore\\",\\"Unexpectedly lost primary lease\\")}class e_{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&M(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new e_((r,i)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(r,i)},this.catchCallback=e=>{this.wrapFailure(t,e).next(r,i)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof e_?t:e_.resolve(t)}catch(e){return e_.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):e_.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):e_.reject(t)}static resolve(e){return new e_((t,r)=>{t(e)})}static reject(e){return new e_((t,r)=>{r(e)})}static waitFor(e){return new e_((t,r)=>{let i=0,n=0,s=!1;e.forEach(e=>{++i,e.next(()=>{++n,s&&n===i&&t()},e=>r(e))}),s=!0,n===i&&t()})}static or(e){let t=e_.resolve(!1);for(let r of e)t=t.next(e=>e?e_.resolve(e):r());return t}static forEach(e,t){let r=[];return e.forEach((e,i)=>{r.push(t.call(this,e,i))}),this.waitFor(r)}static mapArray(e,t){return new e_((r,i)=>{let n=e.length,s=Array(n),a=0;for(let o=0;o{s[l]=e,++a===n&&r(s)},e=>i(e))}})}static doWhile(e,t){return new e_((r,i)=>{let n=()=>{!0===e()?t().next(()=>{n()},i):r()};n()})}}function eE(e){return\\"IndexedDbTransactionError\\"===e.name}class eI{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ae(e),this.ue=e=>t.writeSequenceNumber(e))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.ue&&this.ue(e),e}}eI.ce=-1;function eT(e){return 0===e&&1/e==-1/0}function eS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function eC(e,t){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}function eA(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class ek{constructor(e,t){this.comparator=e,this.root=t||eN.EMPTY}insert(e,t){return new ek(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,eN.BLACK,null,null))}remove(e){return new ek(this.comparator,this.root.remove(e,this.comparator).copy(null,null,eN.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let r=this.comparator(e,t.key);if(0===r)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){let i=this.comparator(e,r.key);if(0===i)return t+r.left.size;i<0?r=r.left:(t+=r.left.size+1,r=r.right)}return -1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){let e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(\\", \\")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new eR(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new eR(this.root,e,this.comparator,!1)}getReverseIterator(){return new eR(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new eR(this.root,e,this.comparator,!0)}}class eR{constructor(e,t,r,i){this.isReverse=i,this.nodeStack=[];let n=1;for(;!e.isEmpty();)if(n=t?r(e.key,t):1,t&&i&&(n*=-1),n<0)e=this.isReverse?e.left:e.right;else{if(0===n){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class eN{constructor(e,t,r,i,n){this.key=e,this.value=t,this.color=null!=r?r:eN.RED,this.left=null!=i?i:eN.EMPTY,this.right=null!=n?n:eN.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,i,n){return new eN(null!=e?e:this.key,null!=t?t:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=n?n:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let i=this,n=r(e,i.key);return(i=n<0?i.copy(null,null,null,i.left.insert(e,t,r),null):0===n?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,r))).fixUp()}removeMin(){if(this.left.isEmpty())return eN.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()}remove(e,t){let r,i=this;if(0>t(e,i.key))i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===t(e,i.key)){if(i.right.isEmpty())return eN.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e}rotateLeft(){let e=this.copy(null,null,eN.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,eN.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){return Math.pow(2,this.check())<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw M(43730,{key:this.key,value:this.value});if(this.right.isRed())throw M(14113,{key:this.key,value:this.value});let e=this.left.check();if(e!==this.right.check())throw M(27949);return e+ +!this.isRed()}}eN.EMPTY=null,eN.RED=!0,eN.BLACK=!1,eN.EMPTY=new class{constructor(){this.size=0}get key(){throw M(57766)}get value(){throw M(16141)}get color(){throw M(16727)}get left(){throw M(29726)}get right(){throw M(36894)}copy(e,t,r,i,n){return this}insert(e,t,r){return new eN(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class eO{constructor(e){this.comparator=e,this.data=new ek(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,r)=>(e(t),!1))}forEachInRange(e,t){let r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){let i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let r;for(r=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new eP(this.data.getIterator())}getIteratorFrom(e){return new eP(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size{t=t.add(e)}),t}isEqual(e){if(!(e instanceof eO)||this.size!==e.size)return!1;let t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){let e=t.getNext().key,i=r.getNext().key;if(0!==this.comparator(e,i))return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),\\"SortedSet(\\"+e.toString()+\\")\\"}copy(e){let t=new eO(this.comparator);return t.data=e,t}}class eP{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class eD{constructor(e){this.fields=e,e.sort(es.comparator)}static empty(){return new eD([])}unionWith(e){let t=new eO(es.comparator);for(let e of this.fields)t=t.add(e);for(let r of e)t=t.add(r);return new eD(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ee(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class ex extends Error{constructor(){super(...arguments),this.name=\\"Base64DecodeError\\"}}class eL{constructor(e){this.binaryString=e}static fromBase64String(e){return new eL(function(e){try{return atob(e)}catch(e){throw\\"undefined\\"!=typeof DOMException&&e instanceof DOMException?new ex(\\"Invalid base64 string: \\"+e):e}}(e))}static fromUint8Array(e){return new eL(function(e){let t=\\"\\";for(let r=0;ree2(e,t))}function e3(e,t){var r,i,n,s,a,o;if(e===t)return 0;let l=e1(e),u=e1(t);if(l!==u)return X(l,u);switch(l){case 0:case 0x1fffffffffffff:return 0;case 1:return X(e.booleanValue,t.booleanValue);case 2:let h,c;return h=eF(e.integerValue||e.doubleValue),h<(c=eF(t.integerValue||t.doubleValue))?-1:h>c?1:h===c?0:isNaN(h)?isNaN(c)?0:-1:1;case 3:return e5(e.timestampValue,t.timestampValue);case 4:return e5(eK(e),eK(t));case 5:return Y(e.stringValue,t.stringValue);case 6:let d,f;return r=e.bytesValue,i=t.bytesValue,d=eV(r),f=eV(i),d.compareTo(f);case 7:return function(e,t){let r=e.split(\\"/\\"),i=t.split(\\"/\\");for(let e=0;et.mapValue.fields[e]=ts(r)),t}if(e.arrayValue){let t={arrayValue:{values:[]}};for(let r=0;r<(e.arrayValue.values||[]).length;++r)t.arrayValue.values[r]=ts(e.arrayValue.values[r]);return t}return{...e}}function ta(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===eX}class to{constructor(e){this.value=e}static empty(){return new to({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r{if(!t.isImmediateParentOf(n)){let e=this.getFieldsMap(t);this.applyChanges(e,r,i),r={},i=[],t=n.popLast()}e?r[n.lastSegment()]=ts(e):i.push(n.lastSegment())});let n=this.getFieldsMap(t);this.applyChanges(n,r,i)}delete(e){let t=this.field(e.popLast());ti(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return e2(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;re[t]=r),r))delete e[i]}clone(){return new to(ts(this.value))}}class tl{constructor(e,t,r,i,n,s,a){this.key=e,this.documentType=t,this.version=r,this.readTime=i,this.createTime=n,this.data=s,this.documentState=a}static newInvalidDocument(e){return new tl(e,0,em.min(),em.min(),em.min(),to.empty(),0)}static newFoundDocument(e,t,r,i){return new tl(e,1,t,em.min(),r,i,0)}static newNoDocument(e,t){return new tl(e,2,t,em.min(),em.min(),to.empty(),0)}static newUnknownDocument(e,t){return new tl(e,3,t,em.min(),em.min(),to.empty(),2)}convertToFoundDocument(e,t){return this.createTime.isEqual(em.min())&&(2===this.documentType||0===this.documentType)&&(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=to.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=to.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=em.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof tl&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new tl(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class tu{constructor(e,t){this.position=e,this.inclusive=t}}function th(e,t,r){let i=0;for(let n=0;n\\":return e>0;case\\">=\\":return e>=0;default:return M(47266,{operator:this.op})}}isInequality(){return[\\"<\\",\\"<=\\",\\">\\",\\">=\\",\\"!=\\",\\"not-in\\"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class tg extends tf{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new tg(e,t)}matches(e){return tm(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.Pe||(this.Pe=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function tm(e){return\\"and\\"===e.op}function ty(e){for(let t of e.filters)if(t instanceof tg)return!1;return!0}class tv extends tp{constructor(e,t,r){super(e,t,r),this.key=ea.fromName(r.referenceValue)}matches(e){let t=ea.comparator(e.key,this.key);return this.matchesComparison(t)}}class tw extends tp{constructor(e,t){super(e,\\"in\\",t),this.keys=t_(\\"in\\",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class tb extends tp{constructor(e,t){super(e,\\"not-in\\",t),this.keys=t_(\\"not-in\\",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function t_(e,t){return(t.arrayValue?.values||[]).map(e=>ea.fromName(e.referenceValue))}class tE extends tp{constructor(e,t){super(e,\\"array-contains\\",t)}matches(e){let t=e.data.field(this.field);return te(t)&&e6(t.arrayValue,this.value)}}class tI extends tp{constructor(e,t){super(e,\\"in\\",t)}matches(e){let t=e.data.field(this.field);return null!==t&&e6(this.value.arrayValue,t)}}class tT extends tp{constructor(e,t){super(e,\\"not-in\\",t)}matches(e){if(e6(this.value.arrayValue,{nullValue:\\"NULL_VALUE\\"}))return!1;let t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!e6(this.value.arrayValue,t)}}class tS extends tp{constructor(e,t){super(e,\\"array-contains-any\\",t)}matches(e){let t=e.data.field(this.field);return!(!te(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>e6(this.value.arrayValue,e))}}class tC{constructor(e,t=null,r=[],i=[],n=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=i,this.limit=n,this.startAt=s,this.endAt=a,this.Te=null}}function tA(e,t=null,r=[],i=[],n=null,s=null,a=null){return new tC(e,t,r,i,n,s,a)}function tk(e){if(null===e.Te){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+=\\"|cg:\\"+e.collectionGroup),t+=\\"|f:\\",t+=e.filters.map(e=>(function e(t){if(t instanceof tp)return t.field.canonicalString()+t.op.toString()+e8(t.value);if(ty(t)&&tm(t))return t.filters.map(t=>e(t)).join(\\",\\");{let r=t.filters.map(t=>e(t)).join(\\",\\");return`${t.op}(${r})`}})(e)).join(\\",\\"),t+=\\"|ob:\\",t+=e.orderBy.map(e=>e.field.canonicalString()+e.dir).join(\\",\\"),null==e.limit||(t+=\\"|l:\\",t+=e.limit),e.startAt&&(t+=\\"|lb:\\",t+=e.startAt.inclusive?\\"b:\\":\\"a:\\",t+=e.startAt.position.map(e=>e8(e)).join(\\",\\")),e.endAt&&(t+=\\"|ub:\\",t+=e.endAt.inclusive?\\"a:\\":\\"b:\\",t+=e.endAt.position.map(e=>e8(e)).join(\\",\\")),e.Te=t}return e.Te}function tR(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;nt&&e(i,r.filters[n]),!0):void M(19439)}(e.filters[r],t.filters[r]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!tc(e.startAt,t.startAt)&&tc(e.endAt,t.endAt)}function tN(e){return ea.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}class tO{constructor(e,t=null,r=[],i=[],n=null,s=\\"F\\",a=null,o=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=i,this.limit=n,this.limitType=s,this.startAt=a,this.endAt=o,this.Ie=null,this.Ee=null,this.de=null,this.startAt,this.endAt}}function tP(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function tD(e){return null!==e.collectionGroup}function tx(e){if(null===e.Ie){let t;e.Ie=[];let r=new Set;for(let t of e.explicitOrderBy)e.Ie.push(t),r.add(t.field.canonicalString());let i=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:\\"asc\\";(t=new eO(es.comparator),e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t).forEach(t=>{r.has(t.canonicalString())||t.isKeyField()||e.Ie.push(new td(t,i))}),r.has(es.keyField().canonicalString())||e.Ie.push(new td(es.keyField(),i))}return e.Ie}function tL(e){return e.Ee||(e.Ee=function(e,t){if(\\"F\\"===e.limitType)return tA(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{let t=\\"desc\\"===e.dir?\\"asc\\":\\"desc\\";return new td(e.field,t)});let r=e.endAt?new tu(e.endAt.position,e.endAt.inclusive):null,i=e.startAt?new tu(e.startAt.position,e.startAt.inclusive):null;return tA(e.path,e.collectionGroup,t,e.filters,e.limit,r,i)}}(e,tx(e))),e.Ee}function tM(e,t){let r=e.filters.concat([t]);return new tO(e.path,e.collectionGroup,e.explicitOrderBy.slice(),r,e.limit,e.limitType,e.startAt,e.endAt)}function tU(e,t,r){return new tO(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,r,e.startAt,e.endAt)}function tF(e,t){return tR(tL(e),tL(t))&&e.limitType===t.limitType}function tV(e){return`${tk(tL(e))}|lt:${e.limitType}`}function tj(e){var t;let r;return`Query(target=${r=(t=tL(e)).path.canonicalString(),null!==t.collectionGroup&&(r+=\\" collectionGroup=\\"+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(e=>(function e(t){return t instanceof tp?`${t.field.canonicalString()} ${t.op} ${e8(t.value)}`:t instanceof tg?t.op.toString()+\\" {\\"+t.getFilters().map(e).join(\\" ,\\")+\\"}\\":\\"Filter\\"})(e)).join(\\", \\")}]`),null==t.limit||(r+=\\", limit: \\"+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(e=>`${e.field.canonicalString()} (${e.dir})`).join(\\", \\")}]`),t.startAt&&(r+=\\", startAt: \\",r+=t.startAt.inclusive?\\"b:\\":\\"a:\\",r+=t.startAt.position.map(e=>e8(e)).join(\\",\\")),t.endAt&&(r+=\\", endAt: \\",r+=t.endAt.inclusive?\\"a:\\":\\"b:\\",r+=t.endAt.position.map(e=>e8(e)).join(\\",\\")),`Target(${r})`}; limitType=${e.limitType})`}function tq(e,t){var r,i,n,s;let a,o,l;return t.isFoundDocument()&&(a=t.key.path,null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(a):ea.isDocumentKey(e.path)?e.path.isEqual(a):e.path.isImmediateParentOf(a))&&function(e,t){for(let r of tx(e))if(!r.field.isKeyField()&&null===t.data.field(r.field))return!1;return!0}(e,t)&&function(e,t){for(let r of e.filters)if(!r.matches(t))return!1;return!0}(e,t)&&(r=e,i=t,(!r.startAt||(n=r.startAt,o=th(n,tx(r),i),n.inclusive?!!(o<=0):!!(o<0)))&&(!r.endAt||(s=r.endAt,l=th(s,tx(r),i),s.inclusive?!!(l>=0):!!(l>0))))}function tB(e){return(t,r)=>{let i=!1;for(let n of tx(e)){let e=function(e,t,r){var i;let n,s,a=e.field.isKeyField()?ea.comparator(t.key,r.key):(i=e.field,n=t.data.field(i),s=r.data.field(i),null!==n&&null!==s?e3(n,s):M(42886));switch(e.dir){case\\"asc\\":return a;case\\"desc\\":return -1*a;default:return M(19790,{direction:e.dir})}}(n,t,r);if(0!==e)return e;i=i||n.field.isKeyField()}return 0}}class t${constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),r=this.inner[t];if(void 0!==r){for(let[t,i]of r)if(this.equalsFn(t,e))return i}}has(e){return void 0!==this.get(e)}set(e,t){let r=this.mapKeyFn(e),i=this.inner[r];if(void 0===i)return this.inner[r]=[[e,t]],void this.innerSize++;for(let r=0;r{for(let[t,i]of r)e(t,i)})}isEmpty(){return eA(this.inner)}size(){return this.innerSize}}let tz=new ek(ea.comparator),tH=new ek(ea.comparator);function tK(...e){let t=tH;for(let r of e)t=t.insert(r.key,r);return t}function tG(){return new t$(e=>e.toString(),(e,t)=>e.isEqual(t))}new ek(ea.comparator);let tQ=new eO(ea.comparator);function tW(...e){let t=tQ;for(let r of e)t=t.add(r);return t}let tJ=new eO(X);function tX(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:\\"NaN\\"};if(t===1/0)return{doubleValue:\\"Infinity\\"};if(t===-1/0)return{doubleValue:\\"-Infinity\\"}}return{doubleValue:eT(t)?\\"-0\\":t}}function tY(e){return{integerValue:\\"\\"+e}}class tZ{constructor(){this._=void 0}}class t0 extends tZ{}class t1 extends tZ{constructor(e){super(),this.elements=e}}function t2(e,t){let r=t8(t);for(let t of e.elements)r.some(e=>e2(e,t))||r.push(t);return{arrayValue:{values:r}}}class t6 extends tZ{constructor(e){super(),this.elements=e}}function t3(e,t){let r=t8(t);for(let t of e.elements)r=r.filter(e=>!e2(e,t));return{arrayValue:{values:r}}}class t5 extends tZ{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function t4(e){return eF(e.integerValue||e.doubleValue)}function t8(e){return te(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class t7{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new t7}static exists(e){return new t7(void 0,e)}static updateTime(e){return new t7(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function t9(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class re{}function rt(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new ru(e.key,t7.none()):new rn(e.key,e.data,t7.none());{let r=e.data,i=to.empty(),n=new eO(es.comparator);for(let e of t.fields)if(!n.has(e)){let t=r.field(e);null===t&&e.length>1&&(e=e.popLast(),t=r.field(e)),null===t?i.delete(e):i.set(e,t),n=n.add(e)}return new rs(e.key,i,new eD(n.toArray()),t7.none())}}function rr(e,t,r,i){return e instanceof rn?function(e,t,r,i){if(!t9(e.precondition,t))return r;let n=e.value.clone(),s=rl(e.fieldTransforms,i,t);return n.setAll(s),t.convertToFoundDocument(t.version,n).setHasLocalMutations(),null}(e,t,r,i):e instanceof rs?function(e,t,r,i){if(!t9(e.precondition,t))return r;let n=rl(e.fieldTransforms,i,t),s=t.data;return(s.setAll(ra(e)),s.setAll(n),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===r)?null:r.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,r,i):t9(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):r}function ri(e,t){var r,i;return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(r=e.fieldTransforms,i=t.fieldTransforms,!!(void 0===r&&void 0===i||!(!r||!i)&&ee(r,i,(e,t)=>{var r,i;return e.field.isEqual(t.field)&&(r=e.transform,i=t.transform,r instanceof t1&&i instanceof t1||r instanceof t6&&i instanceof t6?ee(r.elements,i.elements,e2):r instanceof t5&&i instanceof t5?e2(r.Ae,i.Ae):r instanceof t0&&i instanceof t0)})))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class rn extends re{constructor(e,t,r,i=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class rs extends re{constructor(e,t,r,i,n=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=i,this.fieldTransforms=n,this.type=1}getFieldMask(){return this.fieldMask}}function ra(e){let t=new Map;return e.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){let i=e.data.field(r);t.set(r,i)}}),t}function ro(e,t,r){let i=new Map;F(e.length===r.length,32656,{Re:r.length,Ve:e.length});for(let s=0;s{let n=e.get(i.key),s=n.overlayedDocument,a=this.applyToLocalView(s,n.mutatedFields),o=rt(s,a=t.has(i.key)?null:a);null!==o&&r.set(i.key,o),s.isValidDocument()||s.convertToNoDocument(em.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),tW())}isEqual(e){return this.batchId===e.batchId&&ee(this.mutations,e.mutations,(e,t)=>ri(e,t))&&ee(this.baseMutations,e.baseMutations,(e,t)=>ri(e,t))}}class rc{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\\n largestBatchId: ${this.largestBatchId},\\n mutation: ${this.mutation.toString()}\\n }`}}class rd{constructor(e,t){this.count=e,this.unchangedNames=t}}function rf(e){if(void 0===e)return D(\\"GRPC error has no .code\\"),V.UNKNOWN;switch(e){case f.OK:return V.OK;case f.CANCELLED:return V.CANCELLED;case f.UNKNOWN:return V.UNKNOWN;case f.DEADLINE_EXCEEDED:return V.DEADLINE_EXCEEDED;case f.RESOURCE_EXHAUSTED:return V.RESOURCE_EXHAUSTED;case f.INTERNAL:return V.INTERNAL;case f.UNAVAILABLE:return V.UNAVAILABLE;case f.UNAUTHENTICATED:return V.UNAUTHENTICATED;case f.INVALID_ARGUMENT:return V.INVALID_ARGUMENT;case f.NOT_FOUND:return V.NOT_FOUND;case f.ALREADY_EXISTS:return V.ALREADY_EXISTS;case f.PERMISSION_DENIED:return V.PERMISSION_DENIED;case f.FAILED_PRECONDITION:return V.FAILED_PRECONDITION;case f.ABORTED:return V.ABORTED;case f.OUT_OF_RANGE:return V.OUT_OF_RANGE;case f.UNIMPLEMENTED:return V.UNIMPLEMENTED;case f.DATA_LOSS:return V.DATA_LOSS;default:return M(39323,{code:e})}}(p=f||(f={}))[p.OK=0]=\\"OK\\",p[p.CANCELLED=1]=\\"CANCELLED\\",p[p.UNKNOWN=2]=\\"UNKNOWN\\",p[p.INVALID_ARGUMENT=3]=\\"INVALID_ARGUMENT\\",p[p.DEADLINE_EXCEEDED=4]=\\"DEADLINE_EXCEEDED\\",p[p.NOT_FOUND=5]=\\"NOT_FOUND\\",p[p.ALREADY_EXISTS=6]=\\"ALREADY_EXISTS\\",p[p.PERMISSION_DENIED=7]=\\"PERMISSION_DENIED\\",p[p.UNAUTHENTICATED=16]=\\"UNAUTHENTICATED\\",p[p.RESOURCE_EXHAUSTED=8]=\\"RESOURCE_EXHAUSTED\\",p[p.FAILED_PRECONDITION=9]=\\"FAILED_PRECONDITION\\",p[p.ABORTED=10]=\\"ABORTED\\",p[p.OUT_OF_RANGE=11]=\\"OUT_OF_RANGE\\",p[p.UNIMPLEMENTED=12]=\\"UNIMPLEMENTED\\",p[p.INTERNAL=13]=\\"INTERNAL\\",p[p.UNAVAILABLE=14]=\\"UNAVAILABLE\\",p[p.DATA_LOSS=15]=\\"DATA_LOSS\\";let rp=new i([0xffffffff,0xffffffff],0);function rg(e){let t=(new TextEncoder).encode(e),r=new n;return r.update(t),new Uint8Array(r.digest())}function rm(e){let t=new DataView(e.buffer),r=t.getUint32(0,!0),n=t.getUint32(4,!0),s=t.getUint32(8,!0),a=t.getUint32(12,!0);return[new i([r,n],0),new i([s,a],0)]}class ry{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new rv(`Invalid padding: ${t}`);if(r<0||e.length>0&&0===this.hashCount)throw new rv(`Invalid hash count: ${r}`);if(0===e.length&&0!==t)throw new rv(`Invalid padding when bitmap length is 0: ${t}`);this.ge=8*e.length-t,this.pe=i.fromNumber(this.ge)}ye(e,t,r){let n=e.add(t.multiply(i.fromNumber(r)));return 1===n.compare(rp)&&(n=new i([n.getBits(0),n.getBits(1)],0)),n.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<i.insert(e)),i}insert(e){if(0===this.ge)return;let[t,r]=rm(rg(e));for(let e=0;e0&&(this.Oe=!0,this.Me=e)}ke(){let e=tW(),t=tW(),r=tW();return this.Fe.forEach((i,n)=>{switch(n){case 0:e=e.add(i);break;case 2:t=t.add(i);break;case 1:r=r.add(i);break;default:M(38017,{changeType:n})}}),new rb(this.Me,this.xe,e,t,r)}qe(){this.Oe=!1,this.Fe=rA()}Qe(e,t){this.Oe=!0,this.Fe=this.Fe.insert(e,t)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,F(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class rS{constructor(e){this.Ge=e,this.ze=new Map,this.je=tz,this.Je=rC(),this.He=rC(),this.Ye=new ek(X)}Ze(e){for(let t of e.be)e.De&&e.De.isFoundDocument()?this.Xe(t,e.De):this.et(t,e.key,e.De);for(let t of e.removedTargetIds)this.et(t,e.key,e.De)}tt(e){this.forEachTarget(e,t=>{let r=this.nt(t);switch(e.state){case 0:this.rt(t)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(t);break;case 3:this.rt(t)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(t)&&(this.it(t),r.Le(e.resumeToken));break;default:M(56790,{state:e.state})}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ze.forEach((e,r)=>{this.rt(r)&&t(r)})}st(e){let t=e.targetId,r=e.Ce.count,i=this.ot(t);if(i){let n=i.target;if(tN(n))if(0===r){let e=new ea(n.path);this.et(t,e,tl.newNoDocument(e,em.min()))}else F(1===r,20013,{expectedCount:r});else{let i=this._t(t);if(i!==r){let r=this.ut(e),n=r?this.ct(r,e,i):1;0!==n&&(this.it(t),this.Ye=this.Ye.insert(t,2===n?\\"TargetPurposeExistenceFilterMismatchBloom\\":\\"TargetPurposeExistenceFilterMismatch\\"))}}}}ut(e){let t,r,i=e.Ce.unchangedNames;if(!i||!i.bits)return null;let{bits:{bitmap:n=\\"\\",padding:s=0},hashCount:a=0}=i;try{t=eV(n).toUint8Array()}catch(e){if(e instanceof ex)return x(\\"Decoding the base64 bloom filter in existence filter failed (\\"+e.message+\\"); ignoring the bloom filter and falling back to full re-query.\\"),null;throw e}try{r=new ry(t,s,a)}catch(e){return x(e instanceof rv?\\"BloomFilter error: \\":\\"Applying bloom filter failed: \\",e),null}return 0===r.ge?null:r}ct(e,t,r){return 2*(t.Ce.count!==r-this.Pt(e,t.targetId))}Pt(e,t){let r=this.Ge.getRemoteKeysForTarget(t),i=0;return r.forEach(r=>{let n=this.Ge.ht(),s=`projects/${n.projectId}/databases/${n.database}/documents/${r.path.canonicalString()}`;e.mightContain(s)||(this.et(t,r,null),i++)}),i}Tt(e){let t=new Map;this.ze.forEach((r,i)=>{let n=this.ot(i);if(n){if(r.current&&tN(n.target)){let t=new ea(n.target.path);this.It(t).has(i)||this.Et(i,t)||this.et(i,t,tl.newNoDocument(t,e))}r.Be&&(t.set(i,r.ke()),r.qe())}});let r=tW();this.He.forEach((e,t)=>{let i=!0;t.forEachWhile(e=>{let t=this.ot(e);return!t||\\"TargetPurposeLimboResolution\\"===t.purpose||(i=!1,!1)}),i&&(r=r.add(e))}),this.je.forEach((t,r)=>r.setReadTime(e));let i=new rw(e,t,this.Ye,this.je,r);return this.je=tz,this.Je=rC(),this.He=rC(),this.Ye=new ek(X),i}Xe(e,t){if(!this.rt(e))return;let r=2*!!this.Et(e,t.key);this.nt(e).Qe(t.key,r),this.je=this.je.insert(t.key,t),this.Je=this.Je.insert(t.key,this.It(t.key).add(e)),this.He=this.He.insert(t.key,this.dt(t.key).add(e))}et(e,t,r){if(!this.rt(e))return;let i=this.nt(e);this.Et(e,t)?i.Qe(t,1):i.$e(t),this.He=this.He.insert(t,this.dt(t).delete(e)),this.He=this.He.insert(t,this.dt(t).add(e)),r&&(this.je=this.je.insert(t,r))}removeTarget(e){this.ze.delete(e)}_t(e){let t=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let t=this.ze.get(e);return t||(t=new rT,this.ze.set(e,t)),t}dt(e){let t=this.He.get(e);return t||(t=new eO(X),this.He=this.He.insert(e,t)),t}It(e){let t=this.Je.get(e);return t||(t=new eO(X),this.Je=this.Je.insert(e,t)),t}rt(e){let t=null!==this.ot(e);return t||P(\\"WatchChangeAggregator\\",\\"Detected inactive target\\",e),t}ot(e){let t=this.ze.get(e);return t&&t.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new rT),this.Ge.getRemoteKeysForTarget(e).forEach(t=>{this.et(e,t,null)})}Et(e,t){return this.Ge.getRemoteKeysForTarget(e).has(t)}}function rC(){return new ek(ea.comparator)}function rA(){return new ek(ea.comparator)}let rk={asc:\\"ASCENDING\\",desc:\\"DESCENDING\\"},rR={\\"<\\":\\"LESS_THAN\\",\\"<=\\":\\"LESS_THAN_OR_EQUAL\\",\\">\\":\\"GREATER_THAN\\",\\">=\\":\\"GREATER_THAN_OR_EQUAL\\",\\"==\\":\\"EQUAL\\",\\"!=\\":\\"NOT_EQUAL\\",\\"array-contains\\":\\"ARRAY_CONTAINS\\",in:\\"IN\\",\\"not-in\\":\\"NOT_IN\\",\\"array-contains-any\\":\\"ARRAY_CONTAINS_ANY\\"},rN={and:\\"AND\\",or:\\"OR\\"};class rO{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function rP(e,t){return e.useProto3Json||null==t?t:{value:t}}function rD(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\\\\.\\\\d*/,\\"\\").replace(\\"Z\\",\\"\\")}.${(\\"000000000\\"+t.nanoseconds).slice(-9)}Z`:{seconds:\\"\\"+t.seconds,nanos:t.nanoseconds}}function rx(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function rL(e){let t;return F(!!e,49232),em.fromTimestamp(new eg((t=eU(e)).seconds,t.nanos))}function rM(e,t){return rU(e,t).canonicalString()}function rU(e,t){let r=new ei([\\"projects\\",e.projectId,\\"databases\\",e.database]).child(\\"documents\\");return void 0===t?r:r.child(t)}function rF(e){let t=ei.fromString(e);return F(rH(t),10190,{key:t.toString()}),t}function rV(e,t){let r=rF(t);if(r.get(1)!==e.databaseId.projectId)throw new j(V.INVALID_ARGUMENT,\\"Tried to deserialize key from different project: \\"+r.get(1)+\\" vs \\"+e.databaseId.projectId);if(r.get(3)!==e.databaseId.database)throw new j(V.INVALID_ARGUMENT,\\"Tried to deserialize key from different database: \\"+r.get(3)+\\" vs \\"+e.databaseId.database);return new ea(rB(r))}function rj(e,t){return rM(e.databaseId,t)}function rq(e){return new ei([\\"projects\\",e.databaseId.projectId,\\"databases\\",e.databaseId.database]).canonicalString()}function rB(e){return F(e.length>4&&\\"documents\\"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}function r$(e){return{fieldPath:e.canonicalString()}}function rz(e){return es.fromServerFormat(e.fieldPath)}function rH(e){return e.length>=4&&\\"projects\\"===e.get(0)&&\\"databases\\"===e.get(2)}class rK{constructor(e,t,r,i,n=em.min(),s=em.min(),a=eL.EMPTY_BYTE_STRING,o=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=n,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=o}withSequenceNumber(e){return new rK(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new rK(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new rK(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new rK(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class rG{constructor(e){this.yt=e}}class rQ{constructor(){}Dt(e,t){this.Ct(e,t),t.vt()}Ct(e,t){if(\\"nullValue\\"in e)this.Ft(t,5);else if(\\"booleanValue\\"in e)this.Ft(t,10),t.Mt(+!!e.booleanValue);else if(\\"integerValue\\"in e)this.Ft(t,15),t.Mt(eF(e.integerValue));else if(\\"doubleValue\\"in e){let r=eF(e.doubleValue);isNaN(r)?this.Ft(t,13):(this.Ft(t,15),eT(r)?t.Mt(0):t.Mt(r))}else if(\\"timestampValue\\"in e){let r=e.timestampValue;this.Ft(t,20),\\"string\\"==typeof r&&(r=eU(r)),t.xt(`${r.seconds||\\"\\"}`),t.Mt(r.nanos||0)}else if(\\"stringValue\\"in e)this.Ot(e.stringValue,t),this.Nt(t);else if(\\"bytesValue\\"in e)this.Ft(t,30),t.Bt(eV(e.bytesValue)),this.Nt(t);else if(\\"referenceValue\\"in e)this.Lt(e.referenceValue,t);else if(\\"geoPointValue\\"in e){let r=e.geoPointValue;this.Ft(t,45),t.Mt(r.latitude||0),t.Mt(r.longitude||0)}else\\"mapValue\\"in e?ta(e)?this.Ft(t,Number.MAX_SAFE_INTEGER):tn(e)?this.kt(e.mapValue,t):(this.qt(e.mapValue,t),this.Nt(t)):\\"arrayValue\\"in e?(this.Qt(e.arrayValue,t),this.Nt(t)):M(19022,{$t:e})}Ot(e,t){this.Ft(t,25),this.Ut(e,t)}Ut(e,t){t.xt(e)}qt(e,t){let r=e.fields||{};for(let e of(this.Ft(t,55),Object.keys(r)))this.Ot(e,t),this.Ct(r[e],t)}kt(e,t){let r=e.fields||{};this.Ft(t,53);let i=r[e0].arrayValue?.values?.length||0;this.Ft(t,15),t.Mt(eF(i)),this.Ot(e0,t),this.Ct(r[e0],t)}Qt(e,t){let r=e.values||[];for(let e of(this.Ft(t,50),r))this.Ct(e,t)}Lt(e,t){this.Ft(t,37),ea.fromName(e).path.forEach(e=>{this.Ft(t,60),this.Ut(e,t)})}Ft(e,t){e.Mt(t)}Nt(e){e.Mt(2)}}rQ.Kt=new rQ;class rW{constructor(){this.Cn=new rJ}addToCollectionParentIndex(e,t){return this.Cn.add(t),e_.resolve()}getCollectionParents(e,t){return e_.resolve(this.Cn.getEntries(t))}addFieldIndex(e,t){return e_.resolve()}deleteFieldIndex(e,t){return e_.resolve()}deleteAllFieldIndexes(e){return e_.resolve()}createTargetIndexes(e,t){return e_.resolve()}getDocumentsMatchingTarget(e,t){return e_.resolve(null)}getIndexType(e,t){return e_.resolve(0)}getFieldIndexes(e,t){return e_.resolve([])}getNextCollectionGroupToUpdate(e){return e_.resolve(null)}getMinOffset(e,t){return e_.resolve(ev.min())}getMinOffsetFromCollectionGroup(e,t){return e_.resolve(ev.min())}updateCollectionGroup(e,t,r){return e_.resolve()}updateIndexEntries(e,t){return e_.resolve()}}class rJ{constructor(){this.index={}}add(e){let t=e.lastSegment(),r=e.popLast(),i=this.index[t]||new eO(ei.comparator),n=!i.has(r);return this.index[t]=i.add(r),n}has(e){let t=e.lastSegment(),r=e.popLast(),i=this.index[t];return i&&i.has(r)}getEntries(e){return(this.index[e]||new eO(ei.comparator)).toArray()}}new Uint8Array(0);let rX={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class rY{static withCacheSize(e){return new rY(e,rY.DEFAULT_COLLECTION_PERCENTILE,rY.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}}rY.DEFAULT_COLLECTION_PERCENTILE=10,rY.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,rY.DEFAULT=new rY(0x2800000,rY.DEFAULT_COLLECTION_PERCENTILE,rY.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),rY.DISABLED=new rY(-1,0,0);class rZ{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new rZ(0)}static cr(){return new rZ(-1)}}let r0=\\"LruGarbageCollector\\";function r1([e,t],[r,i]){let n=X(e,r);return 0===n?X(t,i):n}class r2{constructor(e){this.Ir=e,this.buffer=new eO(r1),this.Er=0}dr(){return++this.Er}Ar(e){let t=[e,this.dr()];if(this.buffer.sizer1(t,e)&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class r6{constructor(e,t,r){this.garbageCollector=e,this.asyncQueue=t,this.localStore=r,this.Rr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Vr(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return null!==this.Rr}Vr(e){P(r0,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay(\\"lru_garbage_collection\\",e,async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){eE(e)?P(r0,\\"Ignoring IndexedDB error during garbage collection: \\",e):await eb(e)}await this.Vr(3e5)})}}class r3{constructor(e,t){this.mr=e,this.params=t}calculateTargetCount(e,t){return this.mr.gr(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return e_.resolve(eI.ce);let r=new r2(t);return this.mr.forEachTarget(e,e=>r.Ar(e.sequenceNumber)).next(()=>this.mr.pr(e,e=>r.Ar(e))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.mr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.mr.removeOrphanedDocuments(e,t)}collect(e,t){return -1===this.params.cacheSizeCollectionThreshold?(P(\\"LruGarbageCollector\\",\\"Garbage collection skipped; disabled\\"),e_.resolve(rX)):this.getCacheSize(e).next(r=>r(t>this.params.maximumSequenceNumbersToCollect?(P(\\"LruGarbageCollector\\",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),i=this.params.maximumSequenceNumbersToCollect):i=t,s=Date.now(),this.nthSequenceNumber(e,i))).next(i=>(r=i,a=Date.now(),this.removeTargets(e,r,t))).next(t=>(n=t,o=Date.now(),this.removeOrphanedDocuments(e,r))).next(e=>(l=Date.now(),O()<=w.$b.DEBUG&&P(\\"LruGarbageCollector\\",`LRU Garbage Collection\\n\\tCounted targets in ${s-u}ms\\n\\tDetermined least recently used ${i} in `+(a-s)+\\"ms\\\\n\\"+`\\tRemoved ${n} targets in `+(o-a)+\\"ms\\\\n\\"+`\\tRemoved ${e} documents in `+(l-o)+\\"ms\\\\n\\"+`Total Duration: ${l-u}ms`),e_.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:n,documentsRemoved:e})))}}class r5{constructor(){this.changes=new t$(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,tl.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let r=this.changes.get(t);return void 0!==r?e_.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class r4{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class r8{constructor(e,t,r,i){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==r&&rr(r.mutation,e,eD.empty(),eg.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,tW()).next(()=>t))}getLocalViewOfDocuments(e,t,r=tW()){let i=tG();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,r).next(e=>{let t=tK();return e.forEach((e,r)=>{t=t.insert(e,r.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){let r=tG();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,tW()))}populateOverlays(e,t,r){let i=[];return r.forEach(e=>{t.has(e)||i.push(e)}),this.documentOverlayCache.getOverlays(e,i).next(e=>{e.forEach((e,r)=>{t.set(e,r)})})}computeViews(e,t,r,i){let n=tz,s=tG(),a=tG();return t.forEach((e,t)=>{let a=r.get(t.key);i.has(t.key)&&(void 0===a||a.mutation instanceof rs)?n=n.insert(t.key,t):void 0!==a?(s.set(t.key,a.mutation.getFieldMask()),rr(a.mutation,t,a.mutation.getFieldMask(),eg.now())):s.set(t.key,eD.empty())}),this.recalculateAndSaveOverlays(e,n).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>a.set(e,new r4(t,s.get(e)??null))),a))}recalculateAndSaveOverlays(e,t){let r=tG(),i=new ek((e,t)=>e-t),n=tW();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(let n of e)n.keys().forEach(e=>{let s=t.get(e);if(null===s)return;let a=r.get(e)||eD.empty();a=n.applyToLocalView(s,a),r.set(e,a);let o=(i.get(n.batchId)||tW()).add(e);i=i.insert(n.batchId,o)})}).next(()=>{let s=[],a=i.getReverseIterator();for(;a.hasNext();){let i=a.getNext(),o=i.key,l=i.value,u=tG();l.forEach(e=>{if(!n.has(e)){let i=rt(t.get(e),r.get(e));null!==i&&u.set(e,i),n=n.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,o,u))}return e_.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,r,i){return ea.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):tD(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,i):this.getDocumentsMatchingCollectionQuery(e,t,r,i)}getNextDocuments(e,t,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,i).next(n=>{let s=i-n.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,i-n.size):e_.resolve(tG()),a=-1,o=n;return s.next(t=>e_.forEach(t,(t,r)=>(a{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,n)).next(()=>this.computeViews(e,o,t,tW())).next(e=>{let t;return{batchId:a,changes:(t=tH,e.forEach((e,r)=>t=t.insert(e,r.overlayedDocument)),t)}}))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ea(t)).next(e=>{let t=tK();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,r,i){let n=t.collectionGroup,s=tK();return this.indexManager.getCollectionParents(e,n).next(a=>e_.forEach(a,a=>{let o=new tO(a.child(n),null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt);return this.getDocumentsMatchingCollectionQuery(e,o,r,i).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,r,i){let n;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(s=>(n=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,n,i))).next(e=>{n.forEach((t,r)=>{let i=r.getKey();null===e.get(i)&&(e=e.insert(i,tl.newInvalidDocument(i)))});let r=tK();return e.forEach((e,i)=>{let s=n.get(e);void 0!==s&&rr(s.mutation,i,eD.empty(),eg.now()),tq(t,i)&&(r=r.insert(e,i))}),r})}}class r7{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,t){return e_.resolve(this.Lr.get(t))}saveBundleMetadata(e,t){return this.Lr.set(t.id,{id:t.id,version:t.version,createTime:rL(t.createTime)}),e_.resolve()}getNamedQuery(e,t){return e_.resolve(this.kr.get(t))}saveNamedQuery(e,t){var r;let i;return this.kr.set(t.name,{name:t.name,query:(i=function(e){var t,r,i,n;let s,a,o,l,u,h=4===(s=rF(e.parent)).length?ei.emptyPath():rB(s),c=e.structuredQuery,d=c.from?c.from.length:0,f=null;if(d>0){F(1===d,65062);let e=c.from[0];e.allDescendants?f=e.collectionId:h=h.child(e.collectionId)}let p=[];c.where&&(p=(a=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case\\"IS_NAN\\":let t=rz(e.unaryFilter.field);return tp.create(t,\\"==\\",{doubleValue:NaN});case\\"IS_NULL\\":let r=rz(e.unaryFilter.field);return tp.create(r,\\"==\\",{nullValue:\\"NULL_VALUE\\"});case\\"IS_NOT_NAN\\":let i=rz(e.unaryFilter.field);return tp.create(i,\\"!=\\",{doubleValue:NaN});case\\"IS_NOT_NULL\\":let n=rz(e.unaryFilter.field);return tp.create(n,\\"!=\\",{nullValue:\\"NULL_VALUE\\"});case\\"OPERATOR_UNSPECIFIED\\":return M(61313);default:return M(60726)}}(t):void 0!==t.fieldFilter?tp.create(rz(t.fieldFilter.field),function(e){switch(e){case\\"EQUAL\\":return\\"==\\";case\\"NOT_EQUAL\\":return\\"!=\\";case\\"GREATER_THAN\\":return\\">\\";case\\"GREATER_THAN_OR_EQUAL\\":return\\">=\\";case\\"LESS_THAN\\":return\\"<\\";case\\"LESS_THAN_OR_EQUAL\\":return\\"<=\\";case\\"ARRAY_CONTAINS\\":return\\"array-contains\\";case\\"IN\\":return\\"in\\";case\\"NOT_IN\\":return\\"not-in\\";case\\"ARRAY_CONTAINS_ANY\\":return\\"array-contains-any\\";case\\"OPERATOR_UNSPECIFIED\\":return M(58110);default:return M(50506)}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==t.compositeFilter?tg.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case\\"AND\\":return\\"and\\";case\\"OR\\":return\\"or\\";default:return M(1026)}}(t.compositeFilter.op)):M(30097,{filter:t})}(c.where))instanceof tg&&ty(t=a)&&tm(t)?a.getFilters():[a]);let g=[];c.orderBy&&(g=c.orderBy.map(e=>new td(rz(e.field),function(e){switch(e){case\\"ASCENDING\\":return\\"asc\\";case\\"DESCENDING\\":return\\"desc\\";default:return}}(e.direction))));let m=null;c.limit&&(m=null==(o=\\"object\\"==typeof(r=c.limit)?r.value:r)?null:o);let y=null;c.startAt&&(l=!!(i=c.startAt).before,y=new tu(i.values||[],l));let v=null;return c.endAt&&(u=!(n=c.endAt).before,v=new tu(n.values||[],u)),new tO(h,f,g,p,m,\\"F\\",y,v)}({parent:(r=t.bundledQuery).parent,structuredQuery:r.structuredQuery}),\\"LAST\\"===r.limitType?tU(i,i.limit,\\"L\\"):i),readTime:rL(t.readTime)}),e_.resolve()}}class r9{constructor(){this.overlays=new ek(ea.comparator),this.qr=new Map}getOverlay(e,t){return e_.resolve(this.overlays.get(t))}getOverlays(e,t){let r=tG();return e_.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&r.set(t,e)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((r,i)=>{this.St(e,t,i)}),e_.resolve()}removeOverlaysForBatchId(e,t,r){let i=this.qr.get(r);return void 0!==i&&(i.forEach(e=>this.overlays=this.overlays.remove(e)),this.qr.delete(r)),e_.resolve()}getOverlaysForCollection(e,t,r){let i=tG(),n=t.length+1,s=new ea(t.child(\\"\\")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){let e=a.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===n&&e.largestBatchId>r&&i.set(e.getKey(),e)}return e_.resolve(i)}getOverlaysForCollectionGroup(e,t,r,i){let n=new ek((e,t)=>e-t),s=this.overlays.getIterator();for(;s.hasNext();){let e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>r){let t=n.get(e.largestBatchId);null===t&&(t=tG(),n=n.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}let a=tG(),o=n.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=i)););return e_.resolve(a)}St(e,t,r){let i=this.overlays.get(r.key);if(null!==i){let e=this.qr.get(i.largestBatchId).delete(r.key);this.qr.set(i.largestBatchId,e)}this.overlays=this.overlays.insert(r.key,new rc(t,r));let n=this.qr.get(t);void 0===n&&(n=tW(),this.qr.set(t,n)),this.qr.set(t,n.add(r.key))}}class ie{constructor(){this.sessionToken=eL.EMPTY_BYTE_STRING}getSessionToken(e){return e_.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,e_.resolve()}}class it{constructor(){this.Qr=new eO(ir.$r),this.Ur=new eO(ir.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,t){let r=new ir(e,t);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Gr(new ir(e,t))}zr(e,t){e.forEach(e=>this.removeReference(e,t))}jr(e){let t=new ea(new ei([])),r=new ir(t,e),i=new ir(t,e+1),n=[];return this.Ur.forEachInRange([r,i],e=>{this.Gr(e),n.push(e.key)}),n}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){let t=new ea(new ei([])),r=new ir(t,e),i=new ir(t,e+1),n=tW();return this.Ur.forEachInRange([r,i],e=>{n=n.add(e.key)}),n}containsKey(e){let t=new ir(e,0),r=this.Qr.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)}}class ir{constructor(e,t){this.key=e,this.Yr=t}static $r(e,t){return ea.comparator(e.key,t.key)||X(e.Yr,t.Yr)}static Kr(e,t){return X(e.Yr,t.Yr)||ea.comparator(e.key,t.key)}}class ii{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.tr=1,this.Zr=new eO(ir.$r)}checkEmpty(e){return e_.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,r,i){let n=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new rh(n,t,r,i);for(let t of(this.mutationQueue.push(s),i))this.Zr=this.Zr.add(new ir(t.key,n)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return e_.resolve(s)}lookupMutationBatch(e,t){return e_.resolve(this.Xr(t))}getNextMutationBatchAfterBatchId(e,t){let r=this.ei(t+1),i=r<0?0:r;return e_.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return e_.resolve(0===this.mutationQueue.length?-1:this.tr-1)}getAllMutationBatches(e){return e_.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let r=new ir(t,0),i=new ir(t,1/0),n=[];return this.Zr.forEachInRange([r,i],e=>{let t=this.Xr(e.Yr);n.push(t)}),e_.resolve(n)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new eO(X);return t.forEach(e=>{let t=new ir(e,0),i=new ir(e,1/0);this.Zr.forEachInRange([t,i],e=>{r=r.add(e.Yr)})}),e_.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,i=r.length+1,n=r;ea.isDocumentKey(n)||(n=n.child(\\"\\"));let s=new ir(new ea(n),0),a=new eO(X);return this.Zr.forEachWhile(e=>{let t=e.key.path;return!!r.isPrefixOf(t)&&(t.length===i&&(a=a.add(e.Yr)),!0)},s),e_.resolve(this.ti(a))}ti(e){let t=[];return e.forEach(e=>{let r=this.Xr(e);null!==r&&t.push(r)}),t}removeMutationBatch(e,t){F(0===this.ni(t.batchId,\\"removed\\"),55003),this.mutationQueue.shift();let r=this.Zr;return e_.forEach(t.mutations,i=>{let n=new ir(i.key,t.batchId);return r=r.delete(n),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,t){let r=new ir(t,0),i=this.Zr.firstAfterOrEqual(r);return e_.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,e_.resolve()}ni(e,t){return this.ei(e)}ei(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Xr(e){let t=this.ei(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class is{constructor(e){this.ri=e,this.docs=new ek(ea.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let r=t.key,i=this.docs.get(r),n=i?i.size:0,s=this.ri(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:s}),this.size+=s-n,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let r=this.docs.get(t);return e_.resolve(r?r.document.mutableCopy():tl.newInvalidDocument(t))}getEntries(e,t){let r=tz;return t.forEach(e=>{let t=this.docs.get(e);r=r.insert(e,t?t.document.mutableCopy():tl.newInvalidDocument(e))}),e_.resolve(r)}getDocumentsMatchingQuery(e,t,r,i){let n=tz,s=t.path,a=new ea(s.child(\\"__id-9223372036854775808__\\")),o=this.docs.getIteratorFrom(a);for(;o.hasNext();){let{key:e,value:{document:a}}=o.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||0>=function(e,t){let r=e.readTime.compareTo(t.readTime);return 0!==r||0!==(r=ea.comparator(e.documentKey,t.documentKey))?r:X(e.largestBatchId,t.largestBatchId)}(new ev(a.readTime,a.key,-1),r)||(i.has(a.key)||tq(t,a))&&(n=n.insert(a.key,a.mutableCopy()))}return e_.resolve(n)}getAllFromCollectionGroup(e,t,r,i){M(9500)}ii(e,t){return e_.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new ia(this)}getSize(e){return e_.resolve(this.size)}}class ia extends r5{constructor(e){super(),this.Nr=e}applyChanges(e){let t=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?t.push(this.Nr.addEntry(e,i)):this.Nr.removeEntry(r)}),e_.waitFor(t)}getFromCache(e,t){return this.Nr.getEntry(e,t)}getAllFromCache(e,t){return this.Nr.getEntries(e,t)}}class io{constructor(e){this.persistence=e,this.si=new t$(e=>tk(e),tR),this.lastRemoteSnapshotVersion=em.min(),this.highestTargetId=0,this.oi=0,this._i=new it,this.targetCount=0,this.ai=rZ.ur()}forEachTarget(e,t){return this.si.forEach((e,r)=>t(r)),e_.resolve()}getLastRemoteSnapshotVersion(e){return e_.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return e_.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),e_.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.oi&&(this.oi=t),e_.resolve()}Pr(e){this.si.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.ai=new rZ(t),this.highestTargetId=t),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,t){return this.Pr(t),this.targetCount+=1,e_.resolve()}updateTargetData(e,t){return this.Pr(t),e_.resolve()}removeTargetData(e,t){return this.si.delete(t.target),this._i.jr(t.targetId),this.targetCount-=1,e_.resolve()}removeTargets(e,t,r){let i=0,n=[];return this.si.forEach((s,a)=>{a.sequenceNumber<=t&&null===r.get(a.targetId)&&(this.si.delete(s),n.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),e_.waitFor(n).next(()=>i)}getTargetCount(e){return e_.resolve(this.targetCount)}getTargetData(e,t){let r=this.si.get(t)||null;return e_.resolve(r)}addMatchingKeys(e,t,r){return this._i.Wr(t,r),e_.resolve()}removeMatchingKeys(e,t,r){this._i.zr(t,r);let i=this.persistence.referenceDelegate,n=[];return i&&t.forEach(t=>{n.push(i.markPotentiallyOrphaned(e,t))}),e_.waitFor(n)}removeMatchingKeysForTargetId(e,t){return this._i.jr(t),e_.resolve()}getMatchingKeysForTargetId(e,t){let r=this._i.Hr(t);return e_.resolve(r)}containsKey(e,t){return e_.resolve(this._i.containsKey(t))}}class il{constructor(e,t){this.ui={},this.overlays={},this.ci=new eI(0),this.li=!1,this.li=!0,this.hi=new ie,this.referenceDelegate=e(this),this.Pi=new io(this),this.indexManager=new rW,this.remoteDocumentCache=new is(e=>this.referenceDelegate.Ti(e)),this.serializer=new rG(t),this.Ii=new r7(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new r9,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.ui[e.toKey()];return r||(r=new ii(t,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,t,r){P(\\"MemoryPersistence\\",\\"Starting transaction:\\",e);let i=new iu(this.ci.next());return this.referenceDelegate.Ei(),r(i).next(e=>this.referenceDelegate.di(i).next(()=>e)).toPromise().then(e=>(i.raiseOnCommittedEvent(),e))}Ai(e,t){return e_.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,t)))}}class iu extends ew{constructor(e){super(),this.currentSequenceNumber=e}}class ih{constructor(e){this.persistence=e,this.Ri=new it,this.Vi=null}static mi(e){return new ih(e)}get fi(){if(this.Vi)return this.Vi;throw M(60996)}addReference(e,t,r){return this.Ri.addReference(r,t),this.fi.delete(r.toString()),e_.resolve()}removeReference(e,t,r){return this.Ri.removeReference(r,t),this.fi.add(r.toString()),e_.resolve()}markPotentiallyOrphaned(e,t){return this.fi.add(t.toString()),e_.resolve()}removeTarget(e,t){this.Ri.jr(t.targetId).forEach(e=>this.fi.add(e.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.fi.add(e.toString()))}).next(()=>r.removeTargetData(e,t))}Ei(){this.Vi=new Set}di(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return e_.forEach(this.fi,r=>{let i=ea.fromPath(r);return this.gi(e,i).next(e=>{e||t.removeEntry(i,em.min())})}).next(()=>(this.Vi=null,t.apply(e)))}updateLimboDocument(e,t){return this.gi(e,t).next(e=>{e?this.fi.delete(t.toString()):this.fi.add(t.toString())})}Ti(e){return 0}gi(e,t){return e_.or([()=>e_.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ai(e,t)])}}class ic{constructor(e,t){this.persistence=e,this.pi=new t$(e=>(function(e){let t=\\"\\";for(let r=0;r0&&(t+=\\"\\\\x01\\\\x01\\"),t=function(e,t){let r=t,i=e.length;for(let t=0;te.isEqual(t)),this.garbageCollector=new r3(this,t)}static mi(e,t){return new ic(e,t)}Ei(){}di(e){return e_.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}gr(e){let t=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}wr(e){let t=0;return this.pr(e,e=>{t++}).next(()=>t)}pr(e,t){return e_.forEach(this.pi,(r,i)=>this.br(e,r,i).next(e=>e?e_.resolve():t(i)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0,i=this.persistence.getRemoteDocumentCache(),n=i.newChangeBuffer();return i.ii(e,i=>this.br(e,i,t).next(e=>{e||(r++,n.removeEntry(i,em.min()))})).next(()=>n.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.pi.set(t,e.currentSequenceNumber),e_.resolve()}removeTarget(e,t){let r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.pi.set(r,e.currentSequenceNumber),e_.resolve()}removeReference(e,t,r){return this.pi.set(r,e.currentSequenceNumber),e_.resolve()}updateLimboDocument(e,t){return this.pi.set(t,e.currentSequenceNumber),e_.resolve()}Ti(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=function e(t){switch(e1(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:let r=eH(t);return r?16+e(r):16;case 5:return 2*t.stringValue.length;case 6:return eV(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return(t.arrayValue.values||[]).reduce((t,r)=>t+e(r),0);case 10:case 11:var i;let n;return i=t.mapValue,n=0,eC(i.fields,(t,r)=>{n+=t.length+e(r)}),n;default:throw M(13486,{value:t})}}(e.data.value)),t}br(e,t,r){return e_.or([()=>this.persistence.Ai(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{let e=this.pi.get(t);return e_.resolve(void 0!==e&&e>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class id{constructor(e,t,r,i){this.targetId=e,this.fromCache=t,this.Es=r,this.ds=i}static As(e,t){let r=tW(),i=tW();for(let e of t.docChanges)switch(e.type){case 0:r=r.add(e.doc.key);break;case 1:i=i.add(e.doc.key)}return new id(e,t.fromCache,r,i)}}class ip{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class ig{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){let e;return(0,b.nr)()?8:Number((e=(0,b.ZQ)().match(/Android ([\\\\d.]+)/i))?e[1].split(\\".\\").slice(0,2).join(\\".\\"):\\"-1\\")>0?6:4}()}initialize(e,t){this.ps=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,r,i){let n={result:null};return this.ys(e,t).next(e=>{n.result=e}).next(()=>{if(!n.result)return this.ws(e,t,i,r).next(e=>{n.result=e})}).next(()=>{if(n.result)return;let r=new ip;return this.Ss(e,t,r).next(i=>{if(n.result=i,this.Vs)return this.bs(e,t,r,i.size)})}).next(()=>n.result)}bs(e,t,r,i){return r.documentReadCountthis.gs*i?(O()<=w.$b.DEBUG&&P(\\"QueryEngine\\",\\"The SDK decides to create cache indexes for query:\\",tj(t),\\"as using cache indexes may help improve performance.\\"),this.indexManager.createTargetIndexes(e,tL(t))):e_.resolve())}ys(e,t){if(tP(t))return e_.resolve(null);let r=tL(t);return this.indexManager.getIndexType(e,r).next(i=>0===i?null:(null!==t.limit&&1===i&&(r=tL(t=tU(t,null,\\"F\\"))),this.indexManager.getDocumentsMatchingTarget(e,r).next(i=>{let n=tW(...i);return this.ps.getDocuments(e,n).next(i=>this.indexManager.getMinOffset(e,r).next(r=>{let s=this.Ds(t,i);return this.Cs(t,s,n,r.readTime)?this.ys(e,tU(t,null,\\"F\\")):this.vs(e,s,t,r)}))})))}ws(e,t,r,i){return tP(t)||i.isEqual(em.min())?e_.resolve(null):this.ps.getDocuments(e,r).next(n=>{let s,a,o=this.Ds(t,n);return this.Cs(t,o,r,i)?e_.resolve(null):(O()<=w.$b.DEBUG&&P(\\"QueryEngine\\",\\"Re-using previous result from %s to execute query: %s\\",i.toString(),tj(t)),this.vs(e,o,t,(s=i.toTimestamp().seconds,a=i.toTimestamp().nanoseconds+1,new ev(em.fromTimestamp(1e9===a?new eg(s+1,0):new eg(s,a)),ea.empty(),-1))).next(e=>e))})}Ds(e,t){let r=new eO(tB(e));return t.forEach((t,i)=>{tq(e,i)&&(r=r.add(i))}),r}Cs(e,t,r,i){if(null===e.limit)return!1;if(r.size!==t.size)return!0;let n=\\"F\\"===e.limitType?t.last():t.first();return!!n&&(n.hasPendingWrites||n.version.compareTo(i)>0)}Ss(e,t,r){return O()<=w.$b.DEBUG&&P(\\"QueryEngine\\",\\"Using full collection scan to execute query:\\",tj(t)),this.ps.getDocumentsMatchingQuery(e,t,ev.min(),r)}vs(e,t,r,i){return this.ps.getDocumentsMatchingQuery(e,r,i).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}let im=\\"LocalStore\\";class iy{constructor(e,t,r,i){this.persistence=e,this.Fs=t,this.serializer=i,this.Ms=new ek(X),this.xs=new t$(e=>tk(e),tR),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new r8(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction(\\"Collect garbage\\",\\"readwrite-primary\\",t=>e.collect(t,this.Ms))}}async function iv(e,t){return await e.persistence.runTransaction(\\"Handle user change\\",\\"readonly\\",r=>{let i;return e.mutationQueue.getAllMutationBatches(r).next(n=>(i=n,e.Bs(t),e.mutationQueue.getAllMutationBatches(r))).next(t=>{let n=[],s=[],a=tW();for(let e of i)for(let t of(n.push(e.batchId),e.mutations))a=a.add(t.key);for(let e of t)for(let t of(s.push(e.batchId),e.mutations))a=a.add(t.key);return e.localDocuments.getDocuments(r,a).next(e=>({Ls:e,removedBatchIds:n,addedBatchIds:s}))})})}function iw(e){return e.persistence.runTransaction(\\"Get last remote snapshot version\\",\\"readonly\\",t=>e.Pi.getLastRemoteSnapshotVersion(t))}async function ib(e,t,r){let i=e.Ms.get(t);try{r||await e.persistence.runTransaction(\\"Release target\\",r?\\"readwrite\\":\\"readwrite-primary\\",t=>e.persistence.referenceDelegate.removeTarget(t,i))}catch(e){if(!eE(e))throw e;P(im,`Failed to update sequence numbers for target ${t}: ${e}`)}e.Ms=e.Ms.remove(t),e.xs.delete(i.target)}function i_(e,t,r){let i=em.min(),n=tW();return e.persistence.runTransaction(\\"Execute query\\",\\"readwrite\\",s=>{var a;let o;return(a=tL(t),void 0!==(o=e.xs.get(a))?e_.resolve(e.Ms.get(o)):e.Pi.getTargetData(s,a)).next(t=>{if(t)return i=t.lastLimboFreeSnapshotVersion,e.Pi.getMatchingKeysForTargetId(s,t.targetId).next(e=>{n=e})}).next(()=>e.Fs.getDocumentsMatchingQuery(s,t,r?i:em.min(),r?n:tW())).next(r=>{var i,s,a;let o;return i=e,s=t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2)),a=r,o=i.Os.get(s)||em.min(),a.forEach((e,t)=>{t.readTime.compareTo(o)>0&&(o=t.readTime)}),i.Os.set(s,o),{documents:r,Qs:n}})})}class iE{constructor(){this.activeTargetIds=tJ}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){return JSON.stringify({activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()})}}class iI{constructor(){this.Mo=new iE,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.Mo.zs(e),this.xo[e]||\\"not-current\\"}updateQueryState(e,t,r){this.xo[e]=t}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new iE,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class iT{Oo(e){}shutdown(){}}let iS=\\"ConnectivityMonitor\\";class iC{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener(\\"online\\",this.No),window.removeEventListener(\\"offline\\",this.Lo)}Qo(){window.addEventListener(\\"online\\",this.No),window.addEventListener(\\"offline\\",this.Lo)}Bo(){for(let e of(P(iS,\\"Network connectivity changed: AVAILABLE\\"),this.qo))e(0)}ko(){for(let e of(P(iS,\\"Network connectivity changed: UNAVAILABLE\\"),this.qo))e(1)}static v(){return\\"undefined\\"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let iA=null;function ik(){return null===iA?iA=0x10000000+Math.round(0x80000000*Math.random()):iA++,\\"0x\\"+iA.toString(16)}let iR=\\"RestConnection\\",iN={BatchGetDocuments:\\"batchGet\\",Commit:\\"commit\\",RunQuery:\\"runQuery\\",RunAggregationQuery:\\"runAggregationQuery\\"};class iO{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?\\"https\\":\\"http\\",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Uo=t+\\"://\\"+e.host,this.Ko=`projects/${r}/databases/${i}`,this.Wo=this.databaseId.database===eQ?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Go(e,t,r,i,n){let s=ik(),a=this.zo(e,t.toUriEncodedString());P(iR,`Sending RPC \'${e}\' ${s}:`,a,r);let o={\\"google-cloud-resource-prefix\\":this.Ko,\\"x-goog-request-params\\":this.Wo};this.jo(o,i,n);let{host:l}=new URL(a),u=(0,b.zJ)(l);return this.Jo(e,a,o,r,u).then(t=>(P(iR,`Received RPC \'${e}\' ${s}: `,t),t),t=>{throw x(iR,`RPC \'${e}\' ${s} failed with error: `,t,\\"url: \\",a,\\"request:\\",r),t})}Ho(e,t,r,i,n,s){return this.Go(e,t,r,i,n)}jo(e,t,r){e[\\"X-Goog-Api-Client\\"]=\\"gl-js/ fire/\\"+R,e[\\"Content-Type\\"]=\\"text/plain\\",this.databaseInfo.appId&&(e[\\"X-Firebase-GMPID\\"]=this.databaseInfo.appId),t&&t.headers.forEach((t,r)=>e[r]=t),r&&r.headers.forEach((t,r)=>e[r]=t)}zo(e,t){let r=iN[e];return`${this.Uo}/v1/${t}:${r}`}terminate(){}}class iP{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}let iD=\\"WebChannelConnection\\";class ix extends iO{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,t,r,i,n){let a=ik();return new Promise((n,u)=>{let h=new s;h.setWithCredentials(!0),h.listenOnce(o.COMPLETE,()=>{try{switch(h.getLastErrorCode()){case l.NO_ERROR:let t=h.getResponseJson();P(iD,`XHR for RPC \'${e}\' ${a} received:`,JSON.stringify(t)),n(t);break;case l.TIMEOUT:P(iD,`RPC \'${e}\' ${a} timed out`),u(new j(V.DEADLINE_EXCEEDED,\\"Request time out\\"));break;case l.HTTP_ERROR:let r=h.getStatus();if(P(iD,`RPC \'${e}\' ${a} failed with status:`,r,\\"response text:\\",h.getResponseText()),r>0){let e=h.getResponseJson();Array.isArray(e)&&(e=e[0]);let t=e?.error;if(t&&t.status&&t.message){let e,r=(e=t.status.toLowerCase().replace(/_/g,\\"-\\"),Object.values(V).indexOf(e)>=0?e:V.UNKNOWN);u(new j(r,t.message))}else u(new j(V.UNKNOWN,\\"Server responded with status \\"+h.getStatus()))}else u(new j(V.UNAVAILABLE,\\"Connection failed.\\"));break;default:M(9055,{l_:e,streamId:a,h_:h.getLastErrorCode(),P_:h.getLastError()})}}finally{P(iD,`RPC \'${e}\' ${a} completed.`)}});let c=JSON.stringify(i);P(iD,`RPC \'${e}\' ${a} sending request:`,i),h.send(t,\\"POST\\",c,r,15)})}T_(e,t,r){let i=ik(),n=[this.Uo,\\"/\\",\\"google.firestore.v1.Firestore\\",\\"/\\",e,\\"/channel\\"],s=d(),o=c(),l={httpSessionIdParam:\\"gsessionid\\",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},p=this.longPollingOptions.timeoutSeconds;void 0!==p&&(l.longPollingTimeout=Math.round(1e3*p)),this.useFetchStreams&&(l.useFetchStreams=!0),this.jo(l.initMessageHeaders,t,r),l.encodeInitMessageHeaders=!0;let g=n.join(\\"\\");P(iD,`Creating RPC \'${e}\' stream ${i}: ${g}`,l);let m=s.createWebChannel(g,l);this.I_(m);let y=!1,v=!1,w=new iP({Yo:t=>{v?P(iD,`Not sending because RPC \'${e}\' stream ${i} is closed:`,t):(y||(P(iD,`Opening RPC \'${e}\' stream ${i} transport.`),m.open(),y=!0),P(iD,`RPC \'${e}\' stream ${i} sending:`,t),m.send(t))},Zo:()=>m.close()}),b=(e,t,r)=>{e.listen(t,e=>{try{r(e)}catch(e){setTimeout(()=>{throw e},0)}})};return b(m,a.EventType.OPEN,()=>{v||(P(iD,`RPC \'${e}\' stream ${i} transport opened.`),w.o_())}),b(m,a.EventType.CLOSE,()=>{v||(v=!0,P(iD,`RPC \'${e}\' stream ${i} transport closed`),w.a_(),this.E_(m))}),b(m,a.EventType.ERROR,t=>{v||(v=!0,x(iD,`RPC \'${e}\' stream ${i} transport errored. Name:`,t.name,\\"Message:\\",t.message),w.a_(new j(V.UNAVAILABLE,\\"The operation could not be completed\\")))}),b(m,a.EventType.MESSAGE,t=>{if(!v){let r=t.data[0];F(!!r,16349);let n=r?.error||r[0]?.error;if(n){P(iD,`RPC \'${e}\' stream ${i} received error:`,n);let t=n.status,r=function(e){let t=f[e];if(void 0!==t)return rf(t)}(t),s=n.message;void 0===r&&(r=V.INTERNAL,s=\\"Unknown error status: \\"+t+\\" with message \\"+n.message),v=!0,w.a_(new j(r,s)),m.close()}else P(iD,`RPC \'${e}\' stream ${i} received:`,r),w.u_(r)}}),b(o,h.STAT_EVENT,t=>{t.stat===u.PROXY?P(iD,`RPC \'${e}\' stream ${i} detected buffering proxy`):t.stat===u.NOPROXY&&P(iD,`RPC \'${e}\' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{w.__()},0),w}terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(t=>t===e)}}function iL(){return\\"undefined\\"!=typeof document?document:null}function iM(e){return new rO(e,!0)}class iU{constructor(e,t,r=1e3,i=1.5,n=6e4){this.Mi=e,this.timerId=t,this.d_=r,this.A_=i,this.R_=n,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();let t=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),i=Math.max(0,t-r);i>0&&P(\\"ExponentialBackoff\\",`Backing off for ${i} ms (base delay: ${this.V_} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_this.R_&&(this.V_=this.R_)}w_(){null!==this.m_&&(this.m_.skipDelay(),this.m_=null)}cancel(){null!==this.m_&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}let iF=\\"PersistentStream\\";class iV{constructor(e,t,r,i,n,s,a,o){this.Mi=e,this.S_=r,this.b_=i,this.connection=n,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=o,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new iU(e,t)}x_(){return 1===this.state||5===this.state||this.O_()}O_(){return 2===this.state||3===this.state}start(){this.F_=0,4!==this.state?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&null===this.C_&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,4!==e?this.M_.reset():t&&t.code===V.RESOURCE_EXHAUSTED?(D(t.toString()),D(\\"Using maximum backoff delay to prevent overloading the backend.\\"),this.M_.g_()):t&&t.code===V.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(t)}K_(){}auth(){this.state=1;let e=this.W_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,r])=>{this.D_===t&&this.G_(e,r)},t=>{e(()=>{let e=new j(V.UNKNOWN,\\"Fetching auth token failed: \\"+t.message);return this.z_(e)})})}G_(e,t){let r=this.W_(this.D_);this.stream=this.j_(e,t),this.stream.Xo(()=>{r(()=>this.listener.Xo())}),this.stream.t_(()=>{r(()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.t_()))}),this.stream.r_(e=>{r(()=>this.z_(e))}),this.stream.onMessage(e=>{r(()=>1==++this.F_?this.J_(e):this.onNext(e))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return P(iF,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return t=>{this.Mi.enqueueAndForget(()=>this.D_===e?t():(P(iF,\\"stream callback skipped by getCloseGuardedDispatcher.\\"),Promise.resolve()))}}}class ij extends iV{constructor(e,t,r,i,n,s){super(e,\\"listen_stream_connection_backoff\\",\\"listen_stream_idle\\",\\"health_check_timeout\\",t,r,i,s),this.serializer=n}j_(e,t){return this.connection.T_(\\"Listen\\",e,t)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();let t=function(e,t){let r;if(\\"targetChange\\"in t){var i,n;t.targetChange;let s=\\"NO_CHANGE\\"===(i=t.targetChange.targetChangeType||\\"NO_CHANGE\\")?0:\\"ADD\\"===i?1:\\"REMOVE\\"===i?2:\\"CURRENT\\"===i?3:\\"RESET\\"===i?4:M(39313,{state:i}),a=t.targetChange.targetIds||[],o=(n=t.targetChange.resumeToken,e.useProto3Json?(F(void 0===n||\\"string\\"==typeof n,58123),eL.fromBase64String(n||\\"\\")):(F(void 0===n||n instanceof S||n instanceof Uint8Array,16193),eL.fromUint8Array(n||new Uint8Array))),l=t.targetChange.cause;r=new rI(s,a,o,l&&new j(void 0===l.code?V.UNKNOWN:rf(l.code),l.message||\\"\\")||null)}else if(\\"documentChange\\"in t){t.documentChange;let i=t.documentChange;i.document,i.document.name,i.document.updateTime;let n=rV(e,i.document.name),s=rL(i.document.updateTime),a=i.document.createTime?rL(i.document.createTime):em.min(),o=new to({mapValue:{fields:i.document.fields}}),l=tl.newFoundDocument(n,s,a,o);r=new r_(i.targetIds||[],i.removedTargetIds||[],l.key,l)}else if(\\"documentDelete\\"in t){t.documentDelete;let i=t.documentDelete;i.document;let n=rV(e,i.document),s=i.readTime?rL(i.readTime):em.min(),a=tl.newNoDocument(n,s);r=new r_([],i.removedTargetIds||[],a.key,a)}else if(\\"documentRemove\\"in t){t.documentRemove;let i=t.documentRemove;i.document;let n=rV(e,i.document);r=new r_([],i.removedTargetIds||[],n,null)}else{if(!(\\"filter\\"in t))return M(11601,{Rt:t});{t.filter;let e=t.filter;e.targetId;let{count:i=0,unchangedNames:n}=e,s=new rd(i,n);r=new rE(e.targetId,s)}}return r}(this.serializer,e),r=function(e){if(!(\\"targetChange\\"in e))return em.min();let t=e.targetChange;return t.targetIds&&t.targetIds.length?em.min():t.readTime?rL(t.readTime):em.min()}(e);return this.listener.H_(t,r)}Y_(e){let t,r={};r.database=rq(this.serializer),r.addTarget=function(e,t){var r,i;let n,s,a,o,l,u,h,c=t.target;if((n=tN(c)?{documents:{documents:[rj(e,c.path)]}}:{query:(a={structuredQuery:{}},o=c.path,null!==c.collectionGroup?(s=o,a.structuredQuery.from=[{collectionId:c.collectionGroup,allDescendants:!0}]):(s=o.popLast(),a.structuredQuery.from=[{collectionId:o.lastSegment()}]),a.parent=rj(e,s),(l=function(e){if(0!==e.length)return function e(t){var r;let i;return t instanceof tp?function(e){if(\\"==\\"===e.op){if(tr(e.value))return{unaryFilter:{field:r$(e.field),op:\\"IS_NAN\\"}};if(tt(e.value))return{unaryFilter:{field:r$(e.field),op:\\"IS_NULL\\"}}}else if(\\"!=\\"===e.op){if(tr(e.value))return{unaryFilter:{field:r$(e.field),op:\\"IS_NOT_NAN\\"}};if(tt(e.value))return{unaryFilter:{field:r$(e.field),op:\\"IS_NOT_NULL\\"}}}return{fieldFilter:{field:r$(e.field),op:rR[e.op],value:e.value}}}(t):t instanceof tg?1===(i=(r=t).getFilters().map(t=>e(t))).length?i[0]:{compositeFilter:{op:rN[r.op],filters:i}}:M(54877,{filter:t})}(tg.create(e,\\"and\\"))}(c.filters))&&(a.structuredQuery.where=l),(u=function(e){if(0!==e.length)return e.map(e=>({field:r$(e.field),direction:rk[e.dir]}))}(c.orderBy))&&(a.structuredQuery.orderBy=u),null!==(h=rP(e,c.limit))&&(a.structuredQuery.limit=h),c.startAt&&(a.structuredQuery.startAt={before:(r=c.startAt).inclusive,values:r.position}),c.endAt&&(a.structuredQuery.endAt={before:!(i=c.endAt).inclusive,values:i.position}),{ft:a,parent:s}).ft}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=rx(e,t.resumeToken);let r=rP(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(em.min())>0){n.readTime=rD(e,t.snapshotVersion.toTimestamp());let r=rP(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);let i=(this.serializer,null==(t=function(e){switch(e){case\\"TargetPurposeListen\\":return null;case\\"TargetPurposeExistenceFilterMismatch\\":return\\"existence-filter-mismatch\\";case\\"TargetPurposeExistenceFilterMismatchBloom\\":return\\"existence-filter-mismatch-bloom\\";case\\"TargetPurposeLimboResolution\\":return\\"limbo-document\\";default:return M(28987,{purpose:e})}}(e.purpose))?null:{\\"goog-listen-tags\\":t});i&&(r.labels=i),this.q_(r)}Z_(e){let t={};t.database=rq(this.serializer),t.removeTarget=e,this.q_(t)}}class iq{}class iB extends iq{constructor(e,t,r,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new j(V.FAILED_PRECONDITION,\\"The client has already been terminated.\\")}Go(e,t,r,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([n,s])=>this.connection.Go(e,rU(t,r),i,n,s)).catch(e=>{throw\\"FirebaseError\\"===e.name?(e.code===V.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new j(V.UNKNOWN,e.toString())})}Ho(e,t,r,i,n){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.Ho(e,rU(t,r),i,s,a,n)).catch(e=>{throw\\"FirebaseError\\"===e.name?(e.code===V.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new j(V.UNKNOWN,e.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class i${constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state=\\"Unknown\\",this.oa=0,this._a=null,this.aa=!0}ua(){0===this.oa&&(this.ca(\\"Unknown\\"),this._a=this.asyncQueue.enqueueAfterDelay(\\"online_state_timeout\\",1e4,()=>(this._a=null,this.la(\\"Backend didn\'t respond within 10 seconds.\\"),this.ca(\\"Offline\\"),Promise.resolve())))}ha(e){\\"Online\\"===this.state?this.ca(\\"Unknown\\"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca(\\"Offline\\")))}set(e){this.Pa(),this.oa=0,\\"Online\\"===e&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){let t=`Could not reach Cloud Firestore backend. ${e}\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(D(t),this.aa=!1):P(\\"OnlineStateTracker\\",t)}Pa(){null!==this._a&&(this._a.cancel(),this._a=null)}}let iz=\\"RemoteStore\\";class iH{constructor(e,t,r,i,n){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=n,this.Aa.Oo(e=>{r.enqueueAndForget(async()=>{i0(this)&&(P(iz,\\"Restarting streams for network reachability change.\\"),await async function(e){e.Ea.add(4),await iG(e),e.Ra.set(\\"Unknown\\"),e.Ea.delete(4),await iK(e)}(this))})}),this.Ra=new i$(r,i)}}async function iK(e){if(i0(e))for(let t of e.da)await t(!0)}async function iG(e){for(let t of e.da)await t(!1)}function iQ(e,t){e.Ia.has(t.targetId)||(e.Ia.set(t.targetId,t),iZ(e)?iY(e):i7(e).O_()&&iJ(e,t))}function iW(e,t){let r=i7(e);e.Ia.delete(t),r.O_()&&iX(e,t),0===e.Ia.size&&(r.O_()?r.L_():i0(e)&&e.Ra.set(\\"Unknown\\"))}function iJ(e,t){if(e.Va.Ue(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(em.min())>0){let r=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(r)}i7(e).Y_(t)}function iX(e,t){e.Va.Ue(t),i7(e).Z_(t)}function iY(e){e.Va=new rS({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),At:t=>e.Ia.get(t)||null,ht:()=>e.datastore.serializer.databaseId}),i7(e).start(),e.Ra.ua()}function iZ(e){return i0(e)&&!i7(e).x_()&&e.Ia.size>0}function i0(e){return 0===e.Ea.size}async function i1(e){e.Ra.set(\\"Online\\")}async function i2(e){e.Ia.forEach((t,r)=>{iJ(e,t)})}async function i6(e,t){e.Va=void 0,iZ(e)?(e.Ra.ha(t),iY(e)):e.Ra.set(\\"Unknown\\")}async function i3(e,t,r){if(e.Ra.set(\\"Online\\"),t instanceof rI&&2===t.state&&t.cause)try{await async function(e,t){let r=t.cause;for(let i of t.targetIds)e.Ia.has(i)&&(await e.remoteSyncer.rejectListen(i,r),e.Ia.delete(i),e.Va.removeTarget(i))}(e,t)}catch(r){P(iz,\\"Failed to remove targets %s: %s \\",t.targetIds.join(\\",\\"),r),await i5(e,r)}else if(t instanceof r_?e.Va.Ze(t):t instanceof rE?e.Va.st(t):e.Va.tt(t),!r.isEqual(em.min()))try{let t,i=await iw(e.localStore);r.compareTo(i)>=0&&await ((t=e.Va.Tt(r)).targetChanges.forEach((t,i)=>{if(t.resumeToken.approximateByteSize()>0){let n=e.Ia.get(i);n&&e.Ia.set(i,n.withResumeToken(t.resumeToken,r))}}),t.targetMismatches.forEach((t,r)=>{let i=e.Ia.get(t);if(!i)return;e.Ia.set(t,i.withResumeToken(eL.EMPTY_BYTE_STRING,i.snapshotVersion)),iX(e,t);let n=new rK(i.target,t,r,i.sequenceNumber);iJ(e,n)}),e.remoteSyncer.applyRemoteEvent(t))}catch(t){P(iz,\\"Failed to raise snapshot:\\",t),await i5(e,t)}}async function i5(e,t,r){if(!eE(t))throw t;e.Ea.add(1),await iG(e),e.Ra.set(\\"Offline\\"),r||(r=()=>iw(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{P(iz,\\"Retrying IndexedDB access\\"),await r(),e.Ea.delete(1),await iK(e)})}async function i4(e,t){e.asyncQueue.verifyOperationInProgress(),P(iz,\\"RemoteStore received new credentials\\");let r=i0(e);e.Ea.add(3),await iG(e),r&&e.Ra.set(\\"Unknown\\"),await e.remoteSyncer.handleCredentialChange(t),e.Ea.delete(3),await iK(e)}async function i8(e,t){t?(e.Ea.delete(2),await iK(e)):t||(e.Ea.add(2),await iG(e),e.Ra.set(\\"Unknown\\"))}function i7(e){var t,r,i;return e.ma||(t=e.datastore,r=e.asyncQueue,i={Xo:i1.bind(null,e),t_:i2.bind(null,e),r_:i6.bind(null,e),H_:i3.bind(null,e)},t.sa(),e.ma=new ij(r,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,i),e.da.push(async t=>{t?(e.ma.B_(),iZ(e)?iY(e):e.Ra.set(\\"Unknown\\")):(await e.ma.stop(),e.Va=void 0)})),e.ma}class i9{constructor(e,t,r,i,n){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=i,this.removalCallback=n,this.deferred=new q,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,i,n){let s=new i9(e,t,Date.now()+r,i,n);return s.start(r),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new j(V.CANCELLED,\\"Operation cancelled\\"+(e?\\": \\"+e:\\"\\"))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function ne(e,t){if(D(\\"AsyncQueue\\",`${t}: ${e}`),eE(e))return new j(V.UNAVAILABLE,`${t}: ${e}`);throw e}class nt{static emptySet(e){return new nt(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||ea.comparator(t.key,r.key):(e,t)=>ea.comparator(e.key,t.key),this.keyedMap=tK(),this.sortedSet=new ek(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof nt)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){let e=t.getNext().key,i=r.getNext().key;if(!e.isEqual(i))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?\\"DocumentSet ()\\":\\"DocumentSet (\\\\n \\"+e.join(\\" \\\\n\\")+\\"\\\\n)\\"}copy(e,t){let r=new nt;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}class nr{constructor(){this.ga=new ek(ea.comparator)}track(e){let t=e.doc.key,r=this.ga.get(t);r?0!==e.type&&3===r.type?this.ga=this.ga.insert(t,e):3===e.type&&1!==r.type?this.ga=this.ga.insert(t,{type:r.type,doc:e.doc}):2===e.type&&2===r.type?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):2===e.type&&0===r.type?this.ga=this.ga.insert(t,{type:0,doc:e.doc}):1===e.type&&0===r.type?this.ga=this.ga.remove(t):1===e.type&&2===r.type?this.ga=this.ga.insert(t,{type:1,doc:r.doc}):0===e.type&&1===r.type?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):M(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(t,e)}ya(){let e=[];return this.ga.inorderTraversal((t,r)=>{e.push(r)}),e}}class ni{constructor(e,t,r,i,n,s,a,o,l){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=n,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=o,this.hasCachedResults=l}static fromInitialDocuments(e,t,r,i,n){let s=[];return t.forEach(e=>{s.push({type:0,doc:e})}),new ni(e,t,nt.emptySet(t),s,r,i,!0,!1,n)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&tF(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let e=0;ee.Da())}}class ns{constructor(){this.queries=na(),this.onlineState=\\"Unknown\\",this.Ca=new Set}terminate(){var e;let t;e=new j(V.ABORTED,\\"Firestore shutting down\\"),t=this.queries,this.queries=na(),t.forEach((t,r)=>{for(let t of r.Sa)t.onError(e)})}}function na(){return new t$(e=>tV(e),tF)}async function no(e,t){let r=3,i=t.query,n=e.queries.get(i);n?!n.ba()&&t.Da()&&(r=2):(n=new nn,r=+!t.Da());try{switch(r){case 0:n.wa=await e.onListen(i,!0);break;case 1:n.wa=await e.onListen(i,!1);break;case 2:await e.onFirstRemoteStoreListen(i)}}catch(r){let e=ne(r,`Initialization of query \'${tj(t.query)}\' failed`);return void t.onError(e)}e.queries.set(i,n),n.Sa.push(t),t.va(e.onlineState),n.wa&&t.Fa(n.wa)&&nc(e)}async function nl(e,t){let r=t.query,i=3,n=e.queries.get(r);if(n){let e=n.Sa.indexOf(t);e>=0&&(n.Sa.splice(e,1),0===n.Sa.length?i=+!t.Da():!n.ba()&&t.Da()&&(i=2))}switch(i){case 0:return e.queries.delete(r),e.onUnlisten(r,!0);case 1:return e.queries.delete(r),e.onUnlisten(r,!1);case 2:return e.onLastRemoteStoreUnlisten(r);default:return}}function nu(e,t){let r=!1;for(let i of t){let t=i.query,n=e.queries.get(t);if(n){for(let e of n.Sa)e.Fa(i)&&(r=!0);n.wa=i}}r&&nc(e)}function nh(e,t,r){let i=e.queries.get(t);if(i)for(let e of i.Sa)e.onError(r);e.queries.delete(t)}function nc(e){e.Ca.forEach(e=>{e.next()})}(m=g||(g={})).Ma=\\"default\\",m.Cache=\\"cache\\";class nd{constructor(e,t,r){this.query=e,this.xa=t,this.Oa=!1,this.Na=null,this.onlineState=\\"Unknown\\",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){let t=[];for(let r of e.docChanges)3!==r.type&&t.push(r);e=new ni(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),t=!0):this.La(e,this.onlineState)&&(this.ka(e),t=!0),this.Na=e,t}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let t=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),t=!0),t}La(e,t){return!(e.fromCache&&this.Da())||(!this.options.qa||\\"Offline\\"===t)&&(!e.docs.isEmpty()||e.hasCachedResults||\\"Offline\\"===t)}Ba(e){if(e.docChanges.length>0)return!0;let t=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}ka(e){e=ni.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==g.Cache}}class nf{constructor(e){this.key=e}}class np{constructor(e){this.key=e}}class ng{constructor(e,t){this.query=e,this.Ya=t,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=tW(),this.mutatedKeys=tW(),this.eu=tB(e),this.tu=new nt(this.eu)}get nu(){return this.Ya}ru(e,t){let r=t?t.iu:new nr,i=t?t.tu:this.tu,n=t?t.mutatedKeys:this.mutatedKeys,s=i,a=!1,o=\\"F\\"===this.query.limitType&&i.size===this.query.limit?i.last():null,l=\\"L\\"===this.query.limitType&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((e,t)=>{let u=i.get(e),h=tq(this.query,t)?t:null,c=!!u&&this.mutatedKeys.has(u.key),d=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations),f=!1;u&&h?u.data.isEqual(h.data)?c!==d&&(r.track({type:3,doc:h}),f=!0):this.su(u,h)||(r.track({type:2,doc:h}),f=!0,(o&&this.eu(h,o)>0||l&&0>this.eu(h,l))&&(a=!0)):!u&&h?(r.track({type:0,doc:h}),f=!0):u&&!h&&(r.track({type:1,doc:u}),f=!0,(o||l)&&(a=!0)),f&&(h?(s=s.add(h),n=d?n.add(e):n.delete(e)):(s=s.delete(e),n=n.delete(e)))}),null!==this.query.limit)for(;s.size>this.query.limit;){let e=\\"F\\"===this.query.limitType?s.last():s.first();s=s.delete(e.key),n=n.delete(e.key),r.track({type:1,doc:e})}return{tu:s,iu:r,Cs:a,mutatedKeys:n}}su(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,i){let n=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;let s=e.iu.ya();s.sort((e,t)=>{var r,i;let n;return r=e.type,i=t.type,(n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return M(20277,{Rt:e})}})(r)-n(i)||this.eu(e.doc,t.doc)}),this.ou(r),i=i??!1;let a=t&&!i?this._u():[],o=0===this.Xa.size&&this.current&&!i?1:0,l=o!==this.Za;return(this.Za=o,0!==s.length||l)?{snapshot:new ni(this.query,e.tu,n,s,e.mutatedKeys,0===o,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&\\"Offline\\"===e?(this.current=!1,this.applyChanges({tu:this.tu,iu:new nr,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach(e=>this.Ya=this.Ya.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.Ya=this.Ya.delete(e)),this.current=e.current)}_u(){if(!this.current)return[];let e=this.Xa;this.Xa=tW(),this.tu.forEach(e=>{this.uu(e.key)&&(this.Xa=this.Xa.add(e.key))});let t=[];return e.forEach(e=>{this.Xa.has(e)||t.push(new np(e))}),this.Xa.forEach(r=>{e.has(r)||t.push(new nf(r))}),t}cu(e){this.Ya=e.Qs,this.Xa=tW();let t=this.ru(e.documents);return this.applyChanges(t,!0)}lu(){return ni.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,0===this.Za,this.hasCachedResults)}}let nm=\\"SyncEngine\\";class ny{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class nv{constructor(e){this.key=e,this.hu=!1}}class nw{constructor(e,t,r,i,n,s){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=i,this.currentUser=n,this.maxConcurrentLimboResolutions=s,this.Pu={},this.Tu=new t$(e=>tV(e),tF),this.Iu=new Map,this.Eu=new Set,this.du=new ek(ea.comparator),this.Au=new Map,this.Ru=new it,this.Vu={},this.mu=new Map,this.fu=rZ.cr(),this.onlineState=\\"Unknown\\",this.gu=void 0}get isPrimaryClient(){return!0===this.gu}}async function nb(e,t,r=!0){let i,n=nM(e),s=n.Tu.get(t);return s?(n.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.lu()):i=await nE(n,t,r,!0),i}async function n_(e,t){let r=nM(e);await nE(r,t,!0,!1)}async function nE(e,t,r,i){var n,s;let a,o=await (n=e.localStore,s=tL(t),n.persistence.runTransaction(\\"Allocate target\\",\\"readwrite\\",e=>{let t;return n.Pi.getTargetData(e,s).next(r=>r?(t=r,e_.resolve(t)):n.Pi.allocateTargetId(e).next(r=>(t=new rK(s,r,\\"TargetPurposeListen\\",e.currentSequenceNumber),n.Pi.addTargetData(e,t).next(()=>t))))}).then(e=>{let t=n.Ms.get(e.targetId);return(null===t||e.snapshotVersion.compareTo(t.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(e.targetId,e),n.xs.set(s,e.targetId)),e})),l=o.targetId,u=e.sharedClientState.addLocalQueryTarget(l,r);return i&&(a=await nI(e,t,l,\\"current\\"===u,o.resumeToken)),e.isPrimaryClient&&r&&iQ(e.remoteStore,o),a}async function nI(e,t,r,i,n){e.pu=(t,r,i)=>(async function(e,t,r,i){let n=t.view.ru(r);n.Cs&&(n=await i_(e.localStore,t.query,!1).then(({documents:e})=>t.view.ru(e,n)));let s=i&&i.targetChanges.get(t.targetId),a=i&&null!=i.targetMismatches.get(t.targetId),o=t.view.applyChanges(n,e.isPrimaryClient,s,a);return nO(e,t.targetId,o.au),o.snapshot})(e,t,r,i);let s=await i_(e.localStore,t,!0),a=new ng(t,s.Qs),o=a.ru(s.documents),l=rb.createSynthesizedTargetChangeForCurrentChange(r,i&&\\"Offline\\"!==e.onlineState,n),u=a.applyChanges(o,e.isPrimaryClient,l);nO(e,r,u.au);let h=new ny(t,r,a);return e.Tu.set(t,h),e.Iu.has(r)?e.Iu.get(r).push(t):e.Iu.set(r,[t]),u.snapshot}async function nT(e,t,r){let i=e.Tu.get(t),n=e.Iu.get(i.targetId);n.length>1?(e.Iu.set(i.targetId,n.filter(e=>!tF(e,t))),e.Tu.delete(t)):e.isPrimaryClient?(e.sharedClientState.removeLocalQueryTarget(i.targetId),e.sharedClientState.isActiveQueryTarget(i.targetId)||await ib(e.localStore,i.targetId,!1).then(()=>{e.sharedClientState.clearQueryState(i.targetId),r&&iW(e.remoteStore,i.targetId),nR(e,i.targetId)}).catch(eb)):(nR(e,i.targetId),await ib(e.localStore,i.targetId,!0))}async function nS(e,t){let r=e.Tu.get(t),i=e.Iu.get(r.targetId);e.isPrimaryClient&&1===i.length&&(e.sharedClientState.removeLocalQueryTarget(r.targetId),iW(e.remoteStore,r.targetId))}async function nC(e,t){var r;try{let i,n,s=await (r=e.localStore,i=t.snapshotVersion,n=r.Ms,r.persistence.runTransaction(\\"Apply remote event\\",\\"readwrite-primary\\",e=>{var s,a,o;let l,u,h=r.Ns.newChangeBuffer({trackRemovals:!0});n=r.Ms;let c=[];t.targetChanges.forEach((s,a)=>{var o;let l=n.get(a);if(!l)return;c.push(r.Pi.removeMatchingKeys(e,s.removedDocuments,a).next(()=>r.Pi.addMatchingKeys(e,s.addedDocuments,a)));let u=l.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(a)?u=u.withResumeToken(eL.EMPTY_BYTE_STRING,em.min()).withLastLimboFreeSnapshotVersion(em.min()):s.resumeToken.approximateByteSize()>0&&(u=u.withResumeToken(s.resumeToken,i)),n=n.insert(a,u),o=u,(0===l.resumeToken.approximateByteSize()||o.snapshotVersion.toMicroseconds()-l.snapshotVersion.toMicroseconds()>=3e8||s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size>0)&&c.push(r.Pi.updateTargetData(e,u))});let d=tz,f=tW();if(t.documentUpdates.forEach(i=>{t.resolvedLimboDocuments.has(i)&&c.push(r.persistence.referenceDelegate.updateLimboDocument(e,i))}),c.push((s=e,a=h,o=t.documentUpdates,l=tW(),u=tW(),o.forEach(e=>l=l.add(e)),a.getEntries(s,l).next(e=>{let t=tz;return o.forEach((r,i)=>{let n=e.get(r);i.isFoundDocument()!==n.isFoundDocument()&&(u=u.add(r)),i.isNoDocument()&&i.version.isEqual(em.min())?(a.removeEntry(r,i.readTime),t=t.insert(r,i)):!n.isValidDocument()||i.version.compareTo(n.version)>0||0===i.version.compareTo(n.version)&&n.hasPendingWrites?(a.addEntry(i),t=t.insert(r,i)):P(im,\\"Ignoring outdated watch update for \\",r,\\". Current version:\\",n.version,\\" Watch version:\\",i.version)}),{ks:t,qs:u}})).next(e=>{d=e.ks,f=e.qs})),!i.isEqual(em.min())){let t=r.Pi.getLastRemoteSnapshotVersion(e).next(t=>r.Pi.setTargetsMetadata(e,e.currentSequenceNumber,i));c.push(t)}return e_.waitFor(c).next(()=>h.apply(e)).next(()=>r.localDocuments.getLocalViewOfDocuments(e,d,f)).next(()=>d)}).then(e=>(r.Ms=n,e)));t.targetChanges.forEach((t,r)=>{let i=e.Au.get(r);i&&(F(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1,22616),t.addedDocuments.size>0?i.hu=!0:t.modifiedDocuments.size>0?F(i.hu,14607):t.removedDocuments.size>0&&(F(i.hu,42227),i.hu=!1))}),await nD(e,s,t)}catch(e){await eb(e)}}function nA(e,t,r){var i;if(e.isPrimaryClient&&0===r||!e.isPrimaryClient&&1===r){let r,n=[];e.Tu.forEach((e,r)=>{let i=r.view.va(t);i.snapshot&&n.push(i.snapshot)}),(i=e.eventManager).onlineState=t,r=!1,i.queries.forEach((e,i)=>{for(let e of i.Sa)e.va(t)&&(r=!0)}),r&&nc(i),n.length&&e.Pu.H_(n),e.onlineState=t,e.isPrimaryClient&&e.sharedClientState.setOnlineState(t)}}async function nk(e,t,r){e.sharedClientState.updateQueryState(t,\\"rejected\\",r);let i=e.Au.get(t),n=i&&i.key;if(n){let r=new ek(ea.comparator);r=r.insert(n,tl.newNoDocument(n,em.min()));let i=tW().add(n),s=new rw(em.min(),new Map,new ek(X),r,i);await nC(e,s),e.du=e.du.remove(n),e.Au.delete(t),nP(e)}else await ib(e.localStore,t,!1).then(()=>nR(e,t,r)).catch(eb)}function nR(e,t,r=null){for(let i of(e.sharedClientState.removeLocalQueryTarget(t),e.Iu.get(t)))e.Tu.delete(i),r&&e.Pu.yu(i,r);e.Iu.delete(t),e.isPrimaryClient&&e.Ru.jr(t).forEach(t=>{e.Ru.containsKey(t)||nN(e,t)})}function nN(e,t){e.Eu.delete(t.path.canonicalString());let r=e.du.get(t);null!==r&&(iW(e.remoteStore,r),e.du=e.du.remove(t),e.Au.delete(r),nP(e))}function nO(e,t,r){for(let i of r)i instanceof nf?(e.Ru.addReference(i.key,t),function(e,t){let r=t.key,i=r.path.canonicalString();e.du.get(r)||e.Eu.has(i)||(P(nm,\\"New document in limbo: \\"+r),e.Eu.add(i),nP(e))}(e,i)):i instanceof np?(P(nm,\\"Document no longer in limbo: \\"+i.key),e.Ru.removeReference(i.key,t),e.Ru.containsKey(i.key)||nN(e,i.key)):M(19791,{wu:i})}function nP(e){for(;e.Eu.size>0&&e.du.size{s.push(e.pu(o,t,r).then(t=>{if((t||r)&&e.isPrimaryClient){let i=t?!t.fromCache:r?.targetChanges.get(o.targetId)?.current;e.sharedClientState.updateQueryState(o.targetId,i?\\"current\\":\\"not-current\\")}if(t){i.push(t);let e=id.As(o.targetId,t);n.push(e)}}))}),await Promise.all(s),e.Pu.H_(i),await async function(e,t){try{await e.persistence.runTransaction(\\"notifyLocalViewChanges\\",\\"readwrite\\",r=>e_.forEach(t,t=>e_.forEach(t.Es,i=>e.persistence.referenceDelegate.addReference(r,t.targetId,i)).next(()=>e_.forEach(t.ds,i=>e.persistence.referenceDelegate.removeReference(r,t.targetId,i)))))}catch(e){if(!eE(e))throw e;P(im,\\"Failed to update sequence numbers: \\"+e)}for(let r of t){let t=r.targetId;if(!r.fromCache){let r=e.Ms.get(t),i=r.snapshotVersion,n=r.withLastLimboFreeSnapshotVersion(i);e.Ms=e.Ms.insert(t,n)}}}(e.localStore,n))}async function nx(e,t){if(!e.currentUser.isEqual(t)){P(nm,\\"User change. New user:\\",t.toKey());let r=await iv(e.localStore,t);e.currentUser=t,e.mu.forEach(e=>{e.forEach(e=>{e.reject(new j(V.CANCELLED,\\"\'waitForPendingWrites\' promise is rejected due to a user change.\\"))})}),e.mu.clear(),e.sharedClientState.handleUserChange(t,r.removedBatchIds,r.addedBatchIds),await nD(e,r.Ls)}}function nL(e,t){let r=e.Au.get(t);if(r&&r.hu)return tW().add(r.key);{let r=tW(),i=e.Iu.get(t);if(!i)return r;for(let t of i){let i=e.Tu.get(t);r=r.unionWith(i.view.nu)}return r}}function nM(e){return e.remoteStore.remoteSyncer.applyRemoteEvent=nC.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=nL.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=nk.bind(null,e),e.Pu.H_=nu.bind(null,e.eventManager),e.Pu.yu=nh.bind(null,e.eventManager),e}class nU{constructor(){this.kind=\\"memory\\",this.synchronizeTabs=!1}async initialize(e){this.serializer=iM(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){var t,r;return t=this.persistence,r=new ig,new iy(t,r,e.initialUser,this.serializer)}Cu(e){return new il(ih.mi,this.serializer)}Du(e){return new iI}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}nU.provider={build:()=>new nU};class nF extends nU{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,t){return F(this.persistence.referenceDelegate instanceof ic,46915),new r6(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}Cu(e){let t=void 0!==this.cacheSizeBytes?rY.withCacheSize(this.cacheSizeBytes):rY.DEFAULT;return new il(e=>ic.mi(e,t),this.serializer)}}class nV{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>nA(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=nx.bind(null,this.syncEngine),await i8(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new ns}createDatastore(e){var t;let r=iM(e.databaseInfo.databaseId),i=new ix(e.databaseInfo);return t=e.authCredentials,new iB(t,e.appCheckCredentials,i,r)}createRemoteStore(e){var t,r;return t=this.localStore,r=this.datastore,new iH(t,r,e.asyncQueue,e=>nA(this.syncEngine,e,0),iC.v()?new iC:new iT)}createSyncEngine(e,t){var r,i,n,s,a,o;let l;return r=this.localStore,i=this.remoteStore,n=this.eventManager,s=this.sharedClientState,a=e.initialUser,o=e.maxConcurrentLimboResolutions,l=new nw(r,i,n,s,a,o),t&&(l.gu=!0),l}async terminate(){await async function(e){P(iz,\\"RemoteStore shutting down.\\"),e.Ea.add(5),await iG(e),e.Aa.shutdown(),e.Ra.set(\\"Unknown\\")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}nV.provider={build:()=>new nV};class nj{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):D(\\"Uncaught Error in snapshot listener:\\",e.toString()))}Nu(){this.muted=!0}Ou(e,t){setTimeout(()=>{this.muted||e(t)},0)}}let nq=\\"FirestoreClient\\";class nB{constructor(e,t,r,i,n){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=i,this.user=k.UNAUTHENTICATED,this.clientId=J.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=n,this.authCredentials.start(r,async e=>{P(nq,\\"Received user=\\",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(r,e=>(P(nq,\\"Received new app check token=\\",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();let e=new q;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(r){let t=ne(r,\\"Failed to shutdown persistence\\");e.reject(t)}}),e.promise}}async function n$(e,t){e.asyncQueue.verifyOperationInProgress(),P(nq,\\"Initializing OfflineComponentProvider\\");let r=e.configuration;await t.initialize(r);let i=r.initialUser;e.setCredentialChangeListener(async e=>{i.isEqual(e)||(await iv(t.localStore,e),i=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function nz(e,t){e.asyncQueue.verifyOperationInProgress();let r=await nH(e);P(nq,\\"Initializing OnlineComponentProvider\\"),await t.initialize(r,e.configuration),e.setCredentialChangeListener(e=>i4(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,r)=>i4(t.remoteStore,r)),e._onlineComponents=t}async function nH(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){P(nq,\\"Using user provided OfflineComponentProvider\\");try{await n$(e,e._uninitializedComponentsProvider._offline)}catch(t){if(!(\\"FirebaseError\\"===t.name?t.code===V.FAILED_PRECONDITION||t.code===V.UNIMPLEMENTED:!(\\"undefined\\"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code))throw t;x(\\"Error using user provided cache. Falling back to memory cache: \\"+t),await n$(e,new nU)}}else P(nq,\\"Using default OfflineComponentProvider\\"),await n$(e,new nF(void 0));return e._offlineComponents}async function nK(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(P(nq,\\"Using user provided OnlineComponentProvider\\"),await nz(e,e._uninitializedComponentsProvider._online)):(P(nq,\\"Using default OnlineComponentProvider\\"),await nz(e,new nV))),e._onlineComponents}async function nG(e){let t=await nK(e),r=t.eventManager;return r.onListen=nb.bind(null,t.syncEngine),r.onUnlisten=nT.bind(null,t.syncEngine),r.onFirstRemoteStoreListen=n_.bind(null,t.syncEngine),r.onLastRemoteStoreUnlisten=nS.bind(null,t.syncEngine),r}function nQ(e){let t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}let nW=new Map,nJ=\\"firestore.googleapis.com\\";class nX{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new j(V.INVALID_ARGUMENT,\\"Can\'t provide ssl option if host option is not set\\");this.host=nJ,this.ssl=!0}else this.host=e.host,this.ssl=e.ssl??!0;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=0x2800000;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new j(V.INVALID_ARGUMENT,\\"cacheSizeBytes must be at least 1048576\\");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,r,i){if(!0===t&&!0===i)throw new j(V.INVALID_ARGUMENT,`${e} and ${r} cannot be used together.`)})(\\"experimentalForceLongPolling\\",e.experimentalForceLongPolling,\\"experimentalAutoDetectLongPolling\\",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=nQ(e.experimentalLongPollingOptions??{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new j(V.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new j(V.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new j(V.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){var t,r;return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(t=this.experimentalLongPollingOptions,r=e.experimentalLongPollingOptions,t.timeoutSeconds===r.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class nY{constructor(e,t,r,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=i,this.type=\\"firestore-lite\\",this._persistenceKey=\\"(lite)\\",this._settings=new nX({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask=\\"notTerminated\\"}get app(){if(!this._app)throw new j(V.FAILED_PRECONDITION,\\"Firestore was not initialized using the Firebase SDK. \'app\' is not available\\");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return\\"notTerminated\\"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new j(V.FAILED_PRECONDITION,\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\");this._settings=new nX(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new $;switch(e.type){case\\"firstParty\\":return new G(e.sessionIndex||\\"0\\",e.iamToken||null,e.authTokenFactory||null);case\\"provider\\":return e.client;default:throw new j(V.INVALID_ARGUMENT,\\"makeAuthCredentialsProvider failed due to invalid credential type\\")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return\\"notTerminated\\"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){\\"notTerminated\\"===this._terminateTask?await this._terminate():this._terminateTask=\\"notTerminated\\"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){let e;return(e=nW.get(this))&&(P(\\"ComponentProvider\\",\\"Removing Datastore\\"),nW.delete(this),e.terminate()),Promise.resolve()}}class nZ{constructor(e,t,r){this.converter=t,this._query=r,this.type=\\"query\\",this.firestore=e}withConverter(e){return new nZ(this.firestore,e,this._query)}}class n0{constructor(e,t,r){this.converter=t,this._key=r,this.type=\\"document\\",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new n1(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new n0(this.firestore,e,this._key)}toJSON(){return{type:n0._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,r){if(ep(t,n0._jsonSchema))return new n0(e,r||null,new ea(ei.fromString(t.referencePath)))}}n0._jsonSchemaVersion=\\"firestore/documentReference/1.0\\",n0._jsonSchema={type:ef(\\"string\\",n0._jsonSchemaVersion),referencePath:ef(\\"string\\")};class n1 extends nZ{constructor(e,t,r){super(e,t,new tO(r)),this._path=r,this.type=\\"collection\\"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new n0(this.firestore,null,new ea(e))}withConverter(e){return new n1(this.firestore,e,this._path)}}function n2(e,t,...r){if(e=(0,b.Ku)(e),eo(\\"collection\\",\\"path\\",t),e instanceof nY){let i=ei.fromString(t,...r);return eu(i),new n1(e,null,i)}{if(!(e instanceof n0||e instanceof n1))throw new j(V.INVALID_ARGUMENT,\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\");let i=e._path.child(ei.fromString(t,...r));return eu(i),new n1(e.firestore,null,i)}}function n6(e,t,...r){if(e=(0,b.Ku)(e),1==arguments.length&&(t=J.newId()),eo(\\"doc\\",\\"path\\",t),e instanceof nY){let i=ei.fromString(t,...r);return el(i),new n0(e,null,new ea(i))}{if(!(e instanceof n0||e instanceof n1))throw new j(V.INVALID_ARGUMENT,\\"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\");let i=e._path.child(ei.fromString(t,...r));return el(i),new n0(e.firestore,e instanceof n1?e.converter:null,new ea(i))}}let n3=\\"AsyncQueue\\";class n5{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new iU(this,\\"async_queue_retry\\"),this._c=()=>{let e=iL();e&&P(n3,\\"Visibility state changed to \\"+e.visibilityState),this.M_.w_()},this.ac=e;const t=iL();t&&\\"function\\"==typeof t.addEventListener&&t.addEventListener(\\"visibilitychange\\",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;let t=iL();t&&\\"function\\"==typeof t.removeEventListener&&t.removeEventListener(\\"visibilitychange\\",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});let t=new q;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(0!==this.Xu.length){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!eE(e))throw e;P(n3,\\"Operation failed with retryable error: \\"+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){let t=this.ac.then(()=>(this.rc=!0,e().catch(e=>{throw this.nc=e,this.rc=!1,D(\\"INTERNAL UNHANDLED ERROR: \\",n4(e)),e}).then(e=>(this.rc=!1,e))));return this.ac=t,t}enqueueAfterDelay(e,t,r){this.uc(),this.oc.indexOf(e)>-1&&(t=0);let i=i9.createAndSchedule(this,e,t,r,e=>this.hc(e));return this.tc.push(i),i}uc(){this.nc&&M(47125,{Pc:n4(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(let t of this.tc)if(t.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{for(let t of(this.tc.sort((e,t)=>e.targetTimeMs-t.targetTimeMs),this.tc))if(t.skipDelay(),\\"all\\"!==e&&t.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){let t=this.tc.indexOf(e);this.tc.splice(t,1)}}function n4(e){let t=e.message||\\"\\";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+\\"\\\\n\\"+e.stack),t}class n8 extends nY{constructor(e,t,r,i){super(e,t,r,i),this.type=\\"firestore\\",this._queue=new n5,this._persistenceKey=i?.name||\\"[DEFAULT]\\"}async _terminate(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new n5(e),this._firestoreClient=void 0,await e}}}function n7(e,t){let r=\\"object\\"==typeof e?e:(0,y.Sx)(),i=(0,y.j6)(r,\\"firestore\\").getImmediate({identifier:\\"string\\"==typeof e?e:t||eQ});if(!i._initialized){let e=(0,b.yU)(\\"firestore\\");e&&function(e,t,r,i={}){e=ed(e,nY);let n=(0,b.zJ)(t),s=e._getSettings(),a={...s,emulatorOptions:e._getEmulatorOptions()},o=`${t}:${r}`;n&&((0,b.gE)(`https://${o}`),(0,b.P1)(\\"Firestore\\",!0)),s.host!==nJ&&s.host!==o&&x(\\"Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.\\");let l={...s,host:o,ssl:n,emulatorOptions:i};if(!(0,b.bD)(l,a)&&(e._setSettings(l),i.mockUserToken)){let t,r;if(\\"string\\"==typeof i.mockUserToken)t=i.mockUserToken,r=k.MOCK_USER;else{t=(0,b.Fy)(i.mockUserToken,e._app?.options.projectId);let n=i.mockUserToken.sub||i.mockUserToken.user_id;if(!n)throw new j(V.INVALID_ARGUMENT,\\"mockUserToken must contain \'sub\' or \'user_id\' field!\\");r=new k(n)}e._authCredentials=new z(new B(t,r))}}(i,...e)}return i}function n9(e){if(e._terminated)throw new j(V.FAILED_PRECONDITION,\\"The client has already been terminated.\\");return e._firestoreClient||function(e){var t,r,i;let n,s=e._freezeSettings(),a=(t=e._databaseId,r=e._app?.options.appId||\\"\\",new eG(t,r,e._persistenceKey,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,nQ(s.experimentalLongPollingOptions),s.useFetchStreams,s.isUsingEmulator));e._componentsProvider||s.localCache?._offlineComponentProvider&&s.localCache?._onlineComponentProvider&&(e._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),e._firestoreClient=new nB(e._authCredentials,e._appCheckCredentials,e._queue,a,e._componentsProvider&&(i=e._componentsProvider,n=i?._online.build(),{_offline:i?._offline.build(n),_online:n}))}(e),e._firestoreClient}class se{constructor(e){this._byteString=e}static fromBase64String(e){try{return new se(eL.fromBase64String(e))}catch(e){throw new j(V.INVALID_ARGUMENT,\\"Failed to construct data from Base64 string: \\"+e)}}static fromUint8Array(e){return new se(eL.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return\\"Bytes(base64: \\"+this.toBase64()+\\")\\"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:se._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(ep(e,se._jsonSchema))return se.fromBase64String(e.bytes)}}se._jsonSchemaVersion=\\"firestore/bytes/1.0\\",se._jsonSchema={type:ef(\\"string\\",se._jsonSchemaVersion),bytes:ef(\\"string\\")};class st{constructor(...e){for(let t=0;t90)throw new j(V.INVALID_ARGUMENT,\\"Latitude must be a number between -90 and 90, but was: \\"+e);if(!isFinite(t)||t<-180||t>180)throw new j(V.INVALID_ARGUMENT,\\"Longitude must be a number between -180 and 180, but was: \\"+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return X(this._lat,e._lat)||X(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:si._jsonSchemaVersion}}static fromJSON(e){if(ep(e,si._jsonSchema))return new si(e.latitude,e.longitude)}}si._jsonSchemaVersion=\\"firestore/geoPoint/1.0\\",si._jsonSchema={type:ef(\\"string\\",si._jsonSchemaVersion),latitude:ef(\\"number\\"),longitude:ef(\\"number\\")};class sn{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let r=0;r\\"number\\"==typeof e))return new sn(e.vectorValues);throw new j(V.INVALID_ARGUMENT,\\"Expected \'vectorValues\' field to be a number array\\")}}}sn._jsonSchemaVersion=\\"firestore/vectorValue/1.0\\",sn._jsonSchema={type:ef(\\"string\\",sn._jsonSchemaVersion),vectorValues:ef(\\"object\\")};let ss=/^__.*__$/;function sa(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw M(40011,{Ac:e})}}class so{constructor(e,t,r,i,n,s){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=i,void 0===n&&this.Rc(),this.fieldTransforms=n||[],this.fieldMask=s||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new so({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){let t=this.path?.child(e),r=this.Vc({path:t,fc:!1});return r.gc(e),r}yc(e){let t=this.path?.child(e),r=this.Vc({path:t,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return sc(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}Rc(){if(this.path)for(let e=0;e=0)throw sc(`Invalid field path (${t}). Paths must not contain \'~\', \'*\', \'/\', \'[\', or \']\'`,e,!1,void 0,void 0);try{return new st(...t.split(\\".\\"))._internalPath}catch(r){throw sc(`Invalid field path (${t}). Paths must not be empty, begin with \'.\', end with \'.\', or contain \'..\'`,e,!1,void 0,void 0)}}(e,t):t instanceof st?t._internalPath:t._delegate._internalPath}class sg{}class sm extends sg{}function sy(e,t,...r){let i=[];for(let n of(t instanceof sg&&i.push(t),function(e){let t=e.filter(e=>e instanceof sb).length,r=e.filter(e=>e instanceof sv).length;if(t>1||t>0&&r>0)throw new j(V.INVALID_ARGUMENT,\\"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.\\")}(i=i.concat(r)),i))e=n._apply(e);return e}class sv extends sm{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type=\\"where\\"}static _create(e,t,r){return new sv(e,t,r)}_apply(e){let t=this._parse(e);return sI(e._query,t),new nZ(e.firestore,e.converter,tM(e._query,t))}_parse(e){var t;let r,i,n=(r=(t=e.firestore)._freezeSettings(),i=iM(t._databaseId),new sl(t._databaseId,!!r.ignoreUndefinedProperties,i));return function(e,t,r,i,n,s,a){let o;if(n.isKeyField()){if(\\"array-contains\\"===s||\\"array-contains-any\\"===s)throw new j(V.INVALID_ARGUMENT,`Invalid Query. You can\'t perform \'${s}\' queries on documentId().`);if(\\"in\\"===s||\\"not-in\\"===s){sE(a,s);let t=[];for(let r of a)t.push(s_(i,e,r));o={arrayValue:{values:t}}}else o=s_(i,e,a)}else\\"in\\"!==s&&\\"not-in\\"!==s&&\\"array-contains-any\\"!==s||sE(a,s),o=function(e,t,r,i=!1){return function e(t,r){if(su(t=(0,b.Ku)(t))){var i,n;let s;return function(e,t,r){if(!su(r)||!eh(r)){let i=ec(r);throw\\"an object\\"===i?t.Sc(e+\\" a custom object\\"):t.Sc(e+\\" \\"+i)}}(\\"Unsupported field value:\\",r,t),i=t,n=r,s={},eA(i)?n.path&&n.path.length>0&&n.fieldMask.push(n.path):eC(i,(t,r)=>{let i=e(r,n.mc(t));null!=i&&(s[t]=i)}),{mapValue:{fields:s}}}if(t instanceof sr)return function(e,t){if(!sa(t.Ac))throw t.Sc(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.Sc(`${e._methodName}() is not currently supported inside arrays`);let r=e._toFieldTransform(t);r&&t.fieldTransforms.push(r)}(t,r),null;if(void 0===t&&r.ignoreUndefinedProperties)return null;if(r.path&&r.fieldMask.push(r.path),t instanceof Array){if(r.settings.fc&&4!==r.Ac)throw r.Sc(\\"Nested arrays are not supported\\");let i=[],n=0;for(let s of t){let t=e(s,r.wc(n));null==t&&(t={nullValue:\\"NULL_VALUE\\"}),i.push(t),n++}return{arrayValue:{values:i}}}return function(e,t){var r,i,n;if(null===(e=(0,b.Ku)(e)))return{nullValue:\\"NULL_VALUE\\"};if(\\"number\\"==typeof e)return r=t.serializer,\\"number\\"==typeof(n=i=e)&&Number.isInteger(n)&&!eT(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER?tY(i):tX(r,i);if(\\"boolean\\"==typeof e)return{booleanValue:e};if(\\"string\\"==typeof e)return{stringValue:e};if(e instanceof Date){let r=eg.fromDate(e);return{timestampValue:rD(t.serializer,r)}}if(e instanceof eg){let r=new eg(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:rD(t.serializer,r)}}if(e instanceof si)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof se)return{bytesValue:rx(t.serializer,e._byteString)};if(e instanceof n0){let r=t.databaseId,i=e.firestore._databaseId;if(!i.isEqual(r))throw t.Sc(`Document reference is for database ${i.projectId}/${i.database} but should be for database ${r.projectId}/${r.database}`);return{referenceValue:rM(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof sn)return{mapValue:{fields:{[eJ]:{stringValue:eZ},[e0]:{arrayValue:{values:e.toArray().map(e=>{if(\\"number\\"!=typeof e)throw t.Sc(\\"VectorValues must only contain numeric values.\\");return tX(t.serializer,e)})}}}}};throw t.Sc(`Unsupported field value: ${ec(e)}`)}(t,r)}(r,e.Cc(i?4:3,t))}(r,t,a,\\"in\\"===s||\\"not-in\\"===s);return tp.create(n,s,o)}(e._query,\\"where\\",n,e.firestore._databaseId,this._field,this._op,this._value)}}function sw(e,t,r){let i=sp(\\"where\\",e);return sv._create(i,t,r)}class sb extends sg{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new sb(e,t)}_parse(e){let t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:tg.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let r=e;for(let e of t.getFlattenedFilters())sI(r,e),r=tM(r,e)}(e._query,t),new nZ(e.firestore,e.converter,tM(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return\\"and\\"===this.type?\\"and\\":\\"or\\"}}function s_(e,t,r){if(\\"string\\"==typeof(r=(0,b.Ku)(r))){if(\\"\\"===r)throw new j(V.INVALID_ARGUMENT,\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\");if(!tD(t)&&-1!==r.indexOf(\\"/\\"))throw new j(V.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but \'${r}\' contains a \'/\' character.`);let i=t.path.child(ei.fromString(r));if(!ea.isDocumentKey(i))throw new j(V.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but \'${i}\' is not because it has an odd number of segments (${i.length}).`);return e7(e,new ea(i))}if(r instanceof n0)return e7(e,r._key);throw new j(V.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ec(r)}.`)}function sE(e,t){if(!Array.isArray(e)||0===e.length)throw new j(V.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for \'${t.toString()}\' filters.`)}function sI(e,t){let r=function(e,t){for(let r of e)for(let e of r.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case\\"!=\\":return[\\"!=\\",\\"not-in\\"];case\\"array-contains-any\\":case\\"in\\":return[\\"not-in\\"];case\\"not-in\\":return[\\"array-contains-any\\",\\"in\\",\\"not-in\\",\\"!=\\"];default:return[]}}(t.op));if(null!==r)throw r===t.op?new j(V.INVALID_ARGUMENT,`Invalid query. You cannot use more than one \'${t.op.toString()}\' filter.`):new j(V.INVALID_ARGUMENT,`Invalid query. You cannot use \'${t.op.toString()}\' filters with \'${r.toString()}\' filters.`)}class sT{convertValue(e,t=\\"none\\"){switch(e1(e)){case 0:return null;case 1:return e.booleanValue;case 2:return eF(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(eV(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw M(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t=\\"none\\"){let r={};return eC(e,(e,i)=>{r[e]=this.convertValue(i,t)}),r}convertVectorValue(e){return new sn(e.fields?.[e0].arrayValue?.values?.map(e=>eF(e.doubleValue)))}convertGeoPoint(e){return new si(eF(e.latitude),eF(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case\\"previous\\":let r=eH(e);return null==r?null:this.convertValue(r,t);case\\"estimate\\":return this.convertTimestamp(eK(e));default:return null}}convertTimestamp(e){let t=eU(e);return new eg(t.seconds,t.nanos)}convertDocumentKey(e,t){let r=ei.fromString(e);F(rH(r),9688,{name:e});let i=new eW(r.get(1),r.get(3)),n=new ea(r.popFirst(5));return i.isEqual(t)||D(`Document ${n} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),n}}class sS{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class sC extends sd{constructor(e,t,r,i,n,s){super(e,t,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=n}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new sA(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){let r=this._document.data.field(sp(\\"DocumentSnapshot.get\\",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new j(V.FAILED_PRECONDITION,\\"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().\\");let e=this._document,t={};return t.type=sC._jsonSchemaVersion,t.bundle=\\"\\",t.bundleSource=\\"DocumentSnapshot\\",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()&&(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,\\"previous\\"),this._firestore,this.ref.path,t.bundle=\\"NOT SUPPORTED\\"),t}}sC._jsonSchemaVersion=\\"firestore/documentSnapshot/1.0\\",sC._jsonSchema={type:ef(\\"string\\",sC._jsonSchemaVersion),bundleSource:ef(\\"string\\",\\"DocumentSnapshot\\"),bundleName:ef(\\"string\\"),bundle:ef(\\"string\\")};class sA extends sC{data(e={}){return super.data(e)}}class sk{constructor(e,t,r,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new sS(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new sA(this._firestore,this._userDataWriter,r.key,r,new sS(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new j(V.INVALID_ARGUMENT,\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(r=>{let i=new sA(e._firestore,e._userDataWriter,r.doc.key,r.doc,new sS(e._snapshot.mutatedKeys.has(r.doc.key),e._snapshot.fromCache),e.query.converter);return r.doc,{type:\\"added\\",doc:i,oldIndex:-1,newIndex:t++}})}{let r=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{let i=new sA(e._firestore,e._userDataWriter,t.doc.key,t.doc,new sS(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),n=-1,s=-1;return 0!==t.type&&(n=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(s=(r=r.add(t.doc)).indexOf(t.doc.key)),{type:function(e){switch(e){case 0:return\\"added\\";case 2:case 3:return\\"modified\\";case 1:return\\"removed\\";default:return M(61501,{type:e})}}(t.type),doc:i,oldIndex:n,newIndex:s}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new j(V.FAILED_PRECONDITION,\\"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().\\");let e={};e.type=sk._jsonSchemaVersion,e.bundleSource=\\"QuerySnapshot\\",e.bundleName=J.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;let t=[],r=[],i=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),r.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,\\"previous\\")),i.push(e.ref.path))}),this._firestore,this.query._query,e.bundleName,e.bundle=\\"NOT SUPPORTED\\",e}}function sR(e){e=ed(e,n0);let t=ed(e.firestore,n8);return(function(e,t,r={}){let i=new q;return e.asyncQueue.enqueueAndForget(async()=>{var n,s;let a,o;return n=await nG(e),s=e.asyncQueue,a=new nj({next:e=>{a.Nu(),s.enqueueAndForget(()=>nl(n,o));let l=e.docs.has(t);!l&&e.fromCache?i.reject(new j(V.UNAVAILABLE,\\"Failed to get document because the client is offline.\\")):l&&e.fromCache&&r&&\\"server\\"===r.source?i.reject(new j(V.UNAVAILABLE,\'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\"server\\" to retrieve the cached document.)\')):i.resolve(e)},error:e=>i.reject(e)}),no(n,o=new nd(new tO(t.path),a,{includeMetadataChanges:!0,qa:!0}))}),i.promise})(n9(t),e._key).then(r=>{var i,n,s;let a,o;return i=t,n=e,a=(s=r).docs.get(n._key),o=new sN(i),new sC(i,o,n._key,a,new sS(s.hasPendingWrites,s.fromCache),n.converter)})}sk._jsonSchemaVersion=\\"firestore/querySnapshot/1.0\\",sk._jsonSchema={type:ef(\\"string\\",sk._jsonSchemaVersion),bundleSource:ef(\\"string\\",\\"QuerySnapshot\\"),bundleName:ef(\\"string\\"),bundle:ef(\\"string\\")};class sN extends sT{constructor(e){super(),this.firestore=e}convertBytes(e){return new se(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new n0(this.firestore,null,t)}}function sO(e){e=ed(e,nZ);let t=ed(e.firestore,n8),r=n9(t),i=new sN(t);return function(e){if(\\"L\\"===e.limitType&&0===e.explicitOrderBy.length)throw new j(V.UNIMPLEMENTED,\\"limitToLast() queries require specifying at least one orderBy() clause\\")}(e._query),(function(e,t,r={}){let i=new q;return e.asyncQueue.enqueueAndForget(async()=>{var n,s;let a,o;return n=await nG(e),s=e.asyncQueue,o=new nd(t,a=new nj({next:e=>{a.Nu(),s.enqueueAndForget(()=>nl(n,o)),e.fromCache&&\\"server\\"===r.source?i.reject(new j(V.UNAVAILABLE,\'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\"server\\" to retrieve the cached documents.)\')):i.resolve(e)},error:e=>i.reject(e)}),{includeMetadataChanges:!0,qa:!0}),no(n,o)}),i.promise})(r,e._query).then(r=>new sk(t,i,e,r))}new WeakMap,function(e=!0){R=y.MF,(0,y.om)(new v.uA(\\"firestore\\",(t,{instanceIdentifier:r,options:i})=>{let n=t.getProvider(\\"app\\").getImmediate(),s=new n8(new H(t.getProvider(\\"auth-internal\\")),new W(n,t.getProvider(\\"app-check-internal\\")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,[\\"projectId\\"]))throw new j(V.INVALID_ARGUMENT,\'\\"projectId\\" not provided in firebase.initializeApp.\');return new eW(e.options.projectId,t)}(n,r),n);return i={useFetchStreams:e,...i},s._setSettings(i),s},\\"PUBLIC\\").setMultipleInstances(!0)),(0,y.KO)(C,A,void 0),(0,y.KO)(C,A,\\"esm2020\\")}()},1610:(e,t,r)=>{\\"use strict\\";r.d(t,{h1:()=>o,uA:()=>n});var i=r(6653);class n{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode=\\"LAZY\\",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}let s=\\"[DEFAULT]\\";class a{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new i.cY;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&e.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(r)return null;throw e}if(r)return null;throw Error(`Service ${this.name} is not available`)}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(\\"EAGER\\"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:s})}catch(e){}for(let[e,t]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:r});t.resolve(e)}catch(e){}}}}clearInstance(e=s){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>\\"INTERNAL\\"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>\\"_delete\\"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=s){return this.instances.has(e)}getOptions(e=s){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[e,t]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(e)&&t.resolve(i);return i}onInit(e,t){let r=this.normalizeInstanceIdentifier(t),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);let n=this.instances.get(r);return n&&e(n,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){var r;let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e)===s?void 0:r,options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=s){return this.component?this.component.multipleInstances?e:s:e}shouldAutoInitialize(){return!!this.component&&\\"EXPLICIT\\"!==this.component.instantiationMode}}class o{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new a(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},1883:(e,t,r)=>{\\"use strict\\";function i(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status=\\"pending\\",r.catch(()=>{}),r.resolve=t=>{i({status:\\"fulfilled\\",value:t}),e(t)},r.reject=e=>{i({status:\\"rejected\\",reason:e}),t(e)},r}r.d(t,{T:()=>i})},2921:(e,t,r)=>{\\"use strict\\";r.d(t,{Uz:()=>T,Qg:()=>S});var i=r(6672),n=r(6653),s=r(1610);function a(e,t){let r={};for(let i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i]));return r}function o(e){if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),\\"number\\"==typeof e&&isFinite(e)||!0===e||!1===e||\\"[object String]\\"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(e=>o(e));if(\\"function\\"==typeof e||\\"object\\"==typeof e)return a(e,e=>o(e));throw Error(\\"Data cannot be encoded in JSON: \\"+e)}function l(e){if(null==e)return e;if(e[\\"@type\\"])switch(e[\\"@type\\"]){case\\"type.googleapis.com/google.protobuf.Int64Value\\":case\\"type.googleapis.com/google.protobuf.UInt64Value\\":{let t=Number(e.value);if(isNaN(t))throw Error(\\"Data cannot be decoded from JSON: \\"+e);return t}default:throw Error(\\"Data cannot be decoded from JSON: \\"+e)}return Array.isArray(e)?e.map(e=>l(e)):\\"function\\"==typeof e||\\"object\\"==typeof e?a(e,e=>l(e)):e}let u=\\"functions\\",h={OK:\\"ok\\",CANCELLED:\\"cancelled\\",UNKNOWN:\\"unknown\\",INVALID_ARGUMENT:\\"invalid-argument\\",DEADLINE_EXCEEDED:\\"deadline-exceeded\\",NOT_FOUND:\\"not-found\\",ALREADY_EXISTS:\\"already-exists\\",PERMISSION_DENIED:\\"permission-denied\\",UNAUTHENTICATED:\\"unauthenticated\\",RESOURCE_EXHAUSTED:\\"resource-exhausted\\",FAILED_PRECONDITION:\\"failed-precondition\\",ABORTED:\\"aborted\\",OUT_OF_RANGE:\\"out-of-range\\",UNIMPLEMENTED:\\"unimplemented\\",INTERNAL:\\"internal\\",UNAVAILABLE:\\"unavailable\\",DATA_LOSS:\\"data-loss\\"};class c extends n.g{constructor(e,t,r){super(`${u}/${e}`,t||\\"\\"),this.details=r,Object.setPrototypeOf(this,c.prototype)}}function d(e,t){let r,i=function(e){if(e>=200&&e<300)return\\"ok\\";switch(e){case 0:case 500:return\\"internal\\";case 400:return\\"invalid-argument\\";case 401:return\\"unauthenticated\\";case 403:return\\"permission-denied\\";case 404:return\\"not-found\\";case 409:return\\"aborted\\";case 429:return\\"resource-exhausted\\";case 499:return\\"cancelled\\";case 501:return\\"unimplemented\\";case 503:return\\"unavailable\\";case 504:return\\"deadline-exceeded\\"}return\\"unknown\\"}(e),n=i;try{let e=t&&t.error;if(e){let t=e.status;if(\\"string\\"==typeof t){if(!h[t])return new c(\\"internal\\",\\"internal\\");i=h[t],n=t}let s=e.message;\\"string\\"==typeof s&&(n=s),r=e.details,void 0!==r&&(r=l(r))}}catch(e){}return\\"ok\\"===i?null:new c(i,n,r)}class f{constructor(e,t,r,n){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,(0,i.xZ)(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=t.getImmediate({optional:!0}),this.messaging=r.getImmediate({optional:!0}),this.auth||t.get().then(e=>this.auth=e,()=>{}),this.messaging||r.get().then(e=>this.messaging=e,()=>{}),this.appCheck||n?.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{let e=await this.auth.getToken();return e?.accessToken}catch(e){return}}async getMessagingToken(){if(this.messaging&&\\"Notification\\"in self&&\\"granted\\"===Notification.permission)try{return await this.messaging.getToken()}catch(e){return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){let t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){let t=await this.getAuthToken();return{authToken:t,messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}}let p=\\"us-central1\\",g=/^data: (.*?)(?:\\\\n|$)/;class m{constructor(e,t,r,i,n=p,s=(...e)=>fetch(...e)){this.app=e,this.fetchImpl=s,this.emulatorOrigin=null,this.contextProvider=new f(e,t,r,i),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{const e=new URL(n);this.customDomain=e.origin+(\\"/\\"===e.pathname?\\"\\":e.pathname),this.region=p}catch(e){this.customDomain=null,this.region=n}}_delete(){return this.deleteService()}_url(e){let t=this.app.options.projectId;if(null!==this.emulatorOrigin){let r=this.emulatorOrigin;return`${r}/${t}/${this.region}/${e}`}return null!==this.customDomain?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}}function y(e){return e.emulatorOrigin&&(0,n.zJ)(e.emulatorOrigin)?\\"include\\":void 0}async function v(e,t,r,i,n){let s;r[\\"Content-Type\\"]=\\"application/json\\";try{s=await i(e,{method:\\"POST\\",body:JSON.stringify(t),headers:r,credentials:y(n)})}catch(e){return{status:0,json:null}}let a=null;try{a=await s.json()}catch(e){}return{status:s.status,json:a}}async function w(e,t){let r={},i=await e.contextProvider.getContext(t.limitedUseAppCheckTokens);return i.authToken&&(r.Authorization=\\"Bearer \\"+i.authToken),i.messagingToken&&(r[\\"Firebase-Instance-ID-Token\\"]=i.messagingToken),null!==i.appCheckToken&&(r[\\"X-Firebase-AppCheck\\"]=i.appCheckToken),r}async function b(e,t,r,i){var n;let s,a={data:r=o(r)},u=await w(e,i),h=(n=i.timeout||7e4,s=null,{promise:new Promise((e,t)=>{s=setTimeout(()=>{t(new c(\\"deadline-exceeded\\",\\"deadline-exceeded\\"))},n)}),cancel:()=>{s&&clearTimeout(s)}}),f=await Promise.race([v(t,a,u,e.fetchImpl,e),h.promise,e.cancelAllRequests]);if(h.cancel(),!f)throw new c(\\"cancelled\\",\\"Firebase Functions instance was deleted.\\");let p=d(f.status,f.json);if(p)throw p;if(!f.json)throw new c(\\"internal\\",\\"Response is not valid JSON object.\\");let g=f.json.data;if(void 0===g&&(g=f.json.result),void 0===g)throw new c(\\"internal\\",\\"Response is missing data field.\\");return{data:l(g)}}async function _(e,t,r,i){var n,s,a,u;let h,f,p,m,v,b={data:r=o(r)},_=await w(e,i);_[\\"Content-Type\\"]=\\"application/json\\",_.Accept=\\"text/event-stream\\";try{p=await e.fetchImpl(t,{method:\\"POST\\",body:JSON.stringify(b),headers:_,signal:i?.signal,credentials:y(e)})}catch(t){if(t instanceof Error&&\\"AbortError\\"===t.name){let e=new c(\\"cancelled\\",\\"Request was cancelled.\\");return{data:Promise.reject(e),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(e)})}}}let e=d(0,null);return{data:Promise.reject(e),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(e)})}}}let E=new Promise((e,t)=>{m=e,v=t});i?.signal?.addEventListener(\\"abort\\",()=>{let e=new c(\\"cancelled\\",\\"Request was cancelled.\\");v(e)});let I=(n=p.body.getReader(),s=m,a=v,u=i?.signal,h=(e,t)=>{let r=e.match(g);if(!r)return;let i=r[1];try{let e=JSON.parse(i);if(\\"result\\"in e)return void s(l(e.result));if(\\"message\\"in e)return void t.enqueue(l(e.message));if(\\"error\\"in e){let r=d(0,e);t.error(r),a(r);return}}catch(e){if(e instanceof c){t.error(e),a(e);return}}},f=new TextDecoder,new ReadableStream({start(e){let t=\\"\\";return r();async function r(){if(u?.aborted){let t=new c(\\"cancelled\\",\\"Request was cancelled\\");return e.error(t),a(t),Promise.resolve()}try{let{value:i,done:s}=await n.read();if(s){t.trim()&&h(t.trim(),e),e.close();return}if(u?.aborted){let t=new c(\\"cancelled\\",\\"Request was cancelled\\");e.error(t),a(t),await n.cancel();return}let o=(t+=f.decode(i,{stream:!0})).split(\\"\\\\n\\");for(let r of(t=o.pop()||\\"\\",o))r.trim()&&h(r.trim(),e);return r()}catch(r){let t=r instanceof c?r:d(0,null);e.error(t),a(t)}}},cancel:()=>n.cancel()}));return{stream:{[Symbol.asyncIterator](){let e=I.getReader();return{async next(){let{value:t,done:r}=await e.read();return{value:t,done:r}},return:async()=>(await e.cancel(),{done:!0,value:void 0})}}},data:E}}let E=\\"@firebase/functions\\",I=\\"0.13.1\\";function T(e=(0,i.Sx)(),t=p){let r=(0,i.j6)((0,n.Ku)(e),u).getImmediate({identifier:t}),s=(0,n.yU)(\\"functions\\");return s&&function(e,t,r){var i;let s;i=(0,n.Ku)(e),s=(0,n.zJ)(t),i.emulatorOrigin=`http${s?\\"s\\":\\"\\"}://${t}:${r}`,s&&((0,n.gE)(i.emulatorOrigin+\\"/backends\\"),(0,n.P1)(\\"Functions\\",!0))}(r,...s),r}function S(e,t,r){var i;let s;return i=(0,n.Ku)(e),(s=e=>{var n,s,a,o;let l;return n=i,s=t,a=e,o=r||{},l=n._url(s),b(n,l,a,o)}).stream=(e,r)=>{var n,s,a,o;let l;return n=i,s=t,a=e,o=r,l=n._url(s),_(n,l,a,o||{})},s}(0,i.om)(new s.uA(u,(e,{instanceIdentifier:t})=>new m(e.getProvider(\\"app\\").getImmediate(),e.getProvider(\\"auth-internal\\"),e.getProvider(\\"messaging-internal\\"),e.getProvider(\\"app-check-internal\\"),t),\\"PUBLIC\\").setMultipleInstances(!0)),(0,i.KO)(E,I,void 0),(0,i.KO)(E,I,\\"esm2020\\")},5176:(e,t,r)=>{\\"use strict\\";r.d(t,{xI:()=>rg,hg:()=>ts,x9:()=>tn});var i,n=r(6672),s=r(6653),a=r(9979),o=r(1610);function l(){return{\\"dependent-sdk-initialized-before-auth\\":\\"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.\\"}}let u=new s.FA(\\"auth\\",\\"Firebase\\",l()),h=new a.Vy(\\"@firebase/auth\\");function c(e,...t){h.logLevel<=a.$b.ERROR&&h.error(`Auth (${n.MF}): ${e}`,...t)}function d(e,...t){throw m(e,...t)}function f(e,...t){return m(e,...t)}function p(e,t,r){let i={...l(),[t]:r};return new s.FA(\\"auth\\",\\"Firebase\\",i).create(t,{appName:e.name})}function g(e){return p(e,\\"operation-not-supported-in-this-environment\\",\\"Operations that alter the current user are not supported in conjunction with FirebaseServerApp\\")}function m(e,...t){if(\\"string\\"!=typeof e){let r=t[0],i=[...t.slice(1)];return i[0]&&(i[0].appName=e.name),e._errorFactory.create(r,...i)}return u.create(e,...t)}function y(e,t,...r){if(!e)throw m(t,...r)}function v(e){let t=\\"INTERNAL ASSERTION FAILED: \\"+e;throw c(t),Error(t)}function w(){return\\"undefined\\"!=typeof self&&self.location?.href||\\"\\"}function b(){return\\"undefined\\"!=typeof self&&self.location?.protocol||null}class _{constructor(e,t){var r;this.shortDelay=e,this.longDelay=t,r=\\"Short delay should be less than long delay!\\",t>e||v(r),this.isMobile=(0,s.jZ)()||(0,s.lV)()}get(){return!(\\"undefined\\"!=typeof navigator&&navigator&&\\"onLine\\"in navigator&&\\"boolean\\"==typeof navigator.onLine&&(\\"http:\\"===b()||\\"https:\\"===b()||(0,s.sr)()||\\"connection\\"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function E(e,t){var r,i;r=e.emulator,i=\\"Emulator should always be set here\\",r||v(i);let{url:n}=e.emulator;return t?`${n}${t.startsWith(\\"/\\")?t.slice(1):t}`:n}class I{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){return this.fetchImpl?this.fetchImpl:\\"undefined\\"!=typeof self&&\\"fetch\\"in self?self.fetch:\\"undefined\\"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:\\"undefined\\"!=typeof fetch?fetch:void v(\\"Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill\\")}static headers(){return this.headersImpl?this.headersImpl:\\"undefined\\"!=typeof self&&\\"Headers\\"in self?self.Headers:\\"undefined\\"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:\\"undefined\\"!=typeof Headers?Headers:void v(\\"Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill\\")}static response(){return this.responseImpl?this.responseImpl:\\"undefined\\"!=typeof self&&\\"Response\\"in self?self.Response:\\"undefined\\"!=typeof globalThis&&globalThis.Response?globalThis.Response:\\"undefined\\"!=typeof Response?Response:void v(\\"Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill\\")}}let T={CREDENTIAL_MISMATCH:\\"custom-token-mismatch\\",MISSING_CUSTOM_TOKEN:\\"internal-error\\",INVALID_IDENTIFIER:\\"invalid-email\\",MISSING_CONTINUE_URI:\\"internal-error\\",INVALID_PASSWORD:\\"wrong-password\\",MISSING_PASSWORD:\\"missing-password\\",INVALID_LOGIN_CREDENTIALS:\\"invalid-credential\\",EMAIL_EXISTS:\\"email-already-in-use\\",PASSWORD_LOGIN_DISABLED:\\"operation-not-allowed\\",INVALID_IDP_RESPONSE:\\"invalid-credential\\",INVALID_PENDING_TOKEN:\\"invalid-credential\\",FEDERATED_USER_ID_ALREADY_LINKED:\\"credential-already-in-use\\",MISSING_REQ_TYPE:\\"internal-error\\",EMAIL_NOT_FOUND:\\"user-not-found\\",RESET_PASSWORD_EXCEED_LIMIT:\\"too-many-requests\\",EXPIRED_OOB_CODE:\\"expired-action-code\\",INVALID_OOB_CODE:\\"invalid-action-code\\",MISSING_OOB_CODE:\\"internal-error\\",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:\\"requires-recent-login\\",INVALID_ID_TOKEN:\\"invalid-user-token\\",TOKEN_EXPIRED:\\"user-token-expired\\",USER_NOT_FOUND:\\"user-token-expired\\",TOO_MANY_ATTEMPTS_TRY_LATER:\\"too-many-requests\\",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:\\"password-does-not-meet-requirements\\",INVALID_CODE:\\"invalid-verification-code\\",INVALID_SESSION_INFO:\\"invalid-verification-id\\",INVALID_TEMPORARY_PROOF:\\"invalid-credential\\",MISSING_SESSION_INFO:\\"missing-verification-id\\",SESSION_EXPIRED:\\"code-expired\\",MISSING_ANDROID_PACKAGE_NAME:\\"missing-android-pkg-name\\",UNAUTHORIZED_DOMAIN:\\"unauthorized-continue-uri\\",INVALID_OAUTH_CLIENT_ID:\\"invalid-oauth-client-id\\",ADMIN_ONLY_OPERATION:\\"admin-restricted-operation\\",INVALID_MFA_PENDING_CREDENTIAL:\\"invalid-multi-factor-session\\",MFA_ENROLLMENT_NOT_FOUND:\\"multi-factor-info-not-found\\",MISSING_MFA_ENROLLMENT_ID:\\"missing-multi-factor-info\\",MISSING_MFA_PENDING_CREDENTIAL:\\"missing-multi-factor-session\\",SECOND_FACTOR_EXISTS:\\"second-factor-already-in-use\\",SECOND_FACTOR_LIMIT_EXCEEDED:\\"maximum-second-factor-count-exceeded\\",BLOCKING_FUNCTION_ERROR_RESPONSE:\\"internal-error\\",RECAPTCHA_NOT_ENABLED:\\"recaptcha-not-enabled\\",MISSING_RECAPTCHA_TOKEN:\\"missing-recaptcha-token\\",INVALID_RECAPTCHA_TOKEN:\\"invalid-recaptcha-token\\",INVALID_RECAPTCHA_ACTION:\\"invalid-recaptcha-action\\",MISSING_CLIENT_TYPE:\\"missing-client-type\\",MISSING_RECAPTCHA_VERSION:\\"missing-recaptcha-version\\",INVALID_RECAPTCHA_VERSION:\\"invalid-recaptcha-version\\",INVALID_REQ_TYPE:\\"invalid-req-type\\"},S=[\\"/v1/accounts:signInWithCustomToken\\",\\"/v1/accounts:signInWithEmailLink\\",\\"/v1/accounts:signInWithIdp\\",\\"/v1/accounts:signInWithPassword\\",\\"/v1/accounts:signInWithPhoneNumber\\",\\"/v1/token\\"],C=new _(3e4,6e4);function A(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function k(e,t,r,i,n={}){return R(e,n,async()=>{let n={},a={};i&&(\\"GET\\"===t?a=i:n={body:JSON.stringify(i)});let o=(0,s.Am)({key:e.config.apiKey,...a}).slice(1),l=await e._getAdditionalHeaders();l[\\"Content-Type\\"]=\\"application/json\\",e.languageCode&&(l[\\"X-Firebase-Locale\\"]=e.languageCode);let u={method:t,headers:l,...n};return(0,s.c1)()||(u.referrerPolicy=\\"no-referrer\\"),e.emulatorConfig&&(0,s.zJ)(e.emulatorConfig.host)&&(u.credentials=\\"include\\"),I.fetch()(await O(e,e.config.apiHost,r,o),u)})}async function R(e,t,r){e._canInitEmulator=!1;let i={...T,...t};try{let t=new P(e),n=await Promise.race([r(),t.promise]);t.clearNetworkTimeout();let s=await n.json();if(\\"needConfirmation\\"in s)throw D(e,\\"account-exists-with-different-credential\\",s);if(n.ok&&!(\\"errorMessage\\"in s))return s;{let[t,r]=(n.ok?s.errorMessage:s.error.message).split(\\" : \\");if(\\"FEDERATED_USER_ID_ALREADY_LINKED\\"===t)throw D(e,\\"credential-already-in-use\\",s);if(\\"EMAIL_EXISTS\\"===t)throw D(e,\\"email-already-in-use\\",s);if(\\"USER_DISABLED\\"===t)throw D(e,\\"user-disabled\\",s);let a=i[t]||t.toLowerCase().replace(/[_\\\\s]+/g,\\"-\\");if(r)throw p(e,a,r);d(e,a)}}catch(t){if(t instanceof s.g)throw t;d(e,\\"network-request-failed\\",{message:String(t)})}}async function N(e,t,r,i,n={}){let s=await k(e,t,r,i,n);return\\"mfaPendingCredential\\"in s&&d(e,\\"multi-factor-auth-required\\",{_serverResponse:s}),s}async function O(e,t,r,i){let n=`${t}${r}?${i}`,s=e.config.emulator?E(e.config,n):`${e.config.apiScheme}://${n}`;return S.includes(r)&&(await e._persistenceManagerAvailable,\\"COOKIE\\"===e._getPersistenceType())?e._getPersistence()._getFinalTarget(s).toString():s}class P{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(f(this.auth,\\"network-request-failed\\")),C.get())})}}function D(e,t,r){let i={appName:e.name};r.email&&(i.email=r.email),r.phoneNumber&&(i.phoneNumber=r.phoneNumber);let n=f(e,t,i);return n.customData._tokenResponse=r,n}function x(e){return void 0!==e&&void 0!==e.enterprise}class L{constructor(e){if(this.siteKey=\\"\\",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw Error(\\"recaptchaKey undefined\\");this.siteKey=e.recaptchaKey.split(\\"/\\")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)switch(t.enforcementState){case\\"ENFORCE\\":return\\"ENFORCE\\";case\\"AUDIT\\":return\\"AUDIT\\";case\\"OFF\\":return\\"OFF\\";default:return\\"ENFORCEMENT_STATE_UNSPECIFIED\\"}return null}isProviderEnabled(e){return\\"ENFORCE\\"===this.getProviderEnforcementState(e)||\\"AUDIT\\"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled(\\"EMAIL_PASSWORD_PROVIDER\\")||this.isProviderEnabled(\\"PHONE_PROVIDER\\")}}async function M(e,t){return k(e,\\"GET\\",\\"/v2/recaptchaConfig\\",A(e,t))}async function U(e,t){return k(e,\\"POST\\",\\"/v1/accounts:delete\\",t)}async function F(e,t){return k(e,\\"POST\\",\\"/v1/accounts:lookup\\",t)}function V(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function j(e,t=!1){let r=(0,s.Ku)(e),i=await r.getIdToken(t),n=B(i);y(n&&n.exp&&n.auth_time&&n.iat,r.auth,\\"internal-error\\");let a=\\"object\\"==typeof n.firebase?n.firebase:void 0,o=a?.sign_in_provider;return{claims:n,token:i,authTime:V(q(n.auth_time)),issuedAtTime:V(q(n.iat)),expirationTime:V(q(n.exp)),signInProvider:o||null,signInSecondFactor:a?.sign_in_second_factor||null}}function q(e){return 1e3*Number(e)}function B(e){let[t,r,i]=e.split(\\".\\");if(void 0===t||void 0===r||void 0===i)return c(\\"JWT malformed, contained fewer than 3 sections\\"),null;try{let e=(0,s.u)(r);if(!e)return c(\\"Failed to decode base64 JWT payload\\"),null;return JSON.parse(e)}catch(e){return c(\\"Caught error parsing JWT payload as JSON\\",e?.toString()),null}}function $(e){let t=B(e);return y(t,\\"internal-error\\"),y(void 0!==t.exp,\\"internal-error\\"),y(void 0!==t.iat,\\"internal-error\\"),Number(t.exp)-Number(t.iat)}async function z(e,t,r=!1){if(r)return t;try{return await t}catch(t){throw t instanceof s.g&&function({code:e}){return\\"auth/user-disabled\\"===e||\\"auth/user-token-expired\\"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class H{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(!e)return this.errorBackoff=3e4,Math.max(0,(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5);{let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code===\\"auth/network-request-failed\\"&&this.schedule(!0);return}this.schedule()}}class K{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=V(this.lastLoginAt),this.creationTime=V(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function G(e){var t,r;let i=e.auth,n=await e.getIdToken(),s=await z(e,F(i,{idToken:n}));y(s?.users.length,i,\\"internal-error\\");let a=s.users[0];e._notifyReloadListener(a);let o=a.providerUserInfo?.length?W(a.providerUserInfo):[],l=(t=e.providerData,r=o,[...t.filter(e=>!r.some(t=>t.providerId===e.providerId)),...r]),u=e.isAnonymous,h=!(e.email&&a.passwordHash)&&!l?.length;Object.assign(e,{uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:l,metadata:new K(a.createdAt,a.lastLoginAt),isAnonymous:!!u&&h})}async function Q(e){let t=(0,s.Ku)(e);await G(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function W(e){return e.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||\\"\\",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}async function J(e,t){let r=await R(e,{},async()=>{let r=(0,s.Am)({grant_type:\\"refresh_token\\",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:n}=e.config,a=await O(e,i,\\"/v1/token\\",`key=${n}`),o=await e._getAdditionalHeaders();o[\\"Content-Type\\"]=\\"application/x-www-form-urlencoded\\";let l={method:\\"POST\\",headers:o,body:r};return e.emulatorConfig&&(0,s.zJ)(e.emulatorConfig.host)&&(l.credentials=\\"include\\"),I.fetch()(a,l)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function X(e,t){return k(e,\\"POST\\",\\"/v2/accounts:revokeToken\\",A(e,t))}class Y{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){y(e.idToken,\\"internal-error\\"),y(void 0!==e.idToken,\\"internal-error\\"),y(void 0!==e.refreshToken,\\"internal-error\\");let t=\\"expiresIn\\"in e&&void 0!==e.expiresIn?Number(e.expiresIn):$(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){y(0!==e.length,\\"internal-error\\");let t=$(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(y(this.refreshToken,e,\\"user-token-expired\\"),this.refreshToken)?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:r,refreshToken:i,expiresIn:n}=await J(e,t);this.updateTokensAndExpiration(r,i,Number(n))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*r}static fromJSON(e,t){let{refreshToken:r,accessToken:i,expirationTime:n}=t,s=new Y;return r&&(y(\\"string\\"==typeof r,\\"internal-error\\",{appName:e}),s.refreshToken=r),i&&(y(\\"string\\"==typeof i,\\"internal-error\\",{appName:e}),s.accessToken=i),n&&(y(\\"number\\"==typeof n,\\"internal-error\\",{appName:e}),s.expirationTime=n),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Y,this.toJSON())}_performRefresh(){return v(\\"not implemented\\")}}function Z(e,t){y(\\"string\\"==typeof e||void 0===e,\\"internal-error\\",{appName:t})}class ee{constructor({uid:e,auth:t,stsTokenManager:r,...i}){this.providerId=\\"firebase\\",this.proactiveRefresh=new H(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new K(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let t=await z(this,this.stsTokenManager.getToken(this.auth,e));return y(t,this.auth,\\"internal-error\\"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return j(this,e)}reload(){return Q(this)}_assign(e){this!==e&&(y(this.uid===e.uid,this.auth,\\"internal-error\\"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new ee({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){y(!this.reloadListener,this.auth,\\"internal-error\\"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await G(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,n.xZ)(this.auth.app))return Promise.reject(g(this.auth));let e=await this.getIdToken();return await z(this,U(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||\\"\\"}static _fromJSON(e,t){let r=t.displayName??void 0,i=t.email??void 0,n=t.phoneNumber??void 0,s=t.photoURL??void 0,a=t.tenantId??void 0,o=t._redirectEventId??void 0,l=t.createdAt??void 0,u=t.lastLoginAt??void 0,{uid:h,emailVerified:c,isAnonymous:d,providerData:f,stsTokenManager:p}=t;y(h&&p,e,\\"internal-error\\");let g=Y.fromJSON(this.name,p);y(\\"string\\"==typeof h,e,\\"internal-error\\"),Z(r,e.name),Z(i,e.name),y(\\"boolean\\"==typeof c,e,\\"internal-error\\"),y(\\"boolean\\"==typeof d,e,\\"internal-error\\"),Z(n,e.name),Z(s,e.name),Z(a,e.name),Z(o,e.name),Z(l,e.name),Z(u,e.name);let m=new ee({uid:h,auth:e,email:i,emailVerified:c,displayName:r,isAnonymous:d,photoURL:s,phoneNumber:n,tenantId:a,stsTokenManager:g,createdAt:l,lastLoginAt:u});return f&&Array.isArray(f)&&(m.providerData=f.map(e=>({...e}))),o&&(m._redirectEventId=o),m}static async _fromIdTokenResponse(e,t,r=!1){let i=new Y;i.updateFromServerResponse(t);let n=new ee({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await G(n),n}static async _fromGetAccountInfoResponse(e,t,r){let i=t.users[0];y(void 0!==i.localId,\\"internal-error\\");let n=void 0!==i.providerUserInfo?W(i.providerUserInfo):[],s=!(i.email&&i.passwordHash)&&!n?.length,a=new Y;a.updateFromIdToken(r);let o=new ee({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:s});return Object.assign(o,{uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:n,metadata:new K(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!n?.length}),o}}let et=new Map;function er(e){var t,r;t=\\"Expected a class definition\\",e instanceof Function||v(t);let i=et.get(e);return i?(r=\\"Instance stored in cache mismatched with class\\",i instanceof e||v(r)):(i=new e,et.set(e,i)),i}class ei{constructor(){this.type=\\"NONE\\",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}function en(e,t,r){return`firebase:${e}:${t}:${r}`}ei.type=\\"NONE\\";class es{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:n}=this.auth;this.fullUserKey=en(this.userKey,i.apiKey,n),this.fullPersistenceKey=en(\\"persistence\\",i.apiKey,n),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(\\"string\\"==typeof e){let t=await F(this.auth,{idToken:e}).catch(()=>void 0);return t?ee._fromGetAccountInfoResponse(this.auth,t,e):null}return ee._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r=\\"authUser\\"){if(!t.length)return new es(er(ei),e,r);let i=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),n=i[0]||er(ei),s=en(r,e.config.apiKey,e.name),a=null;for(let r of t)try{let t=await r._get(s);if(t){let i;if(\\"string\\"==typeof t){let r=await F(e,{idToken:t}).catch(()=>void 0);if(!r)break;i=await ee._fromGetAccountInfoResponse(e,r,t)}else i=ee._fromJSON(e,t);r!==n&&(a=i),n=r;break}}catch{}let o=i.filter(e=>e._shouldAllowMigration);return n._shouldAllowMigration&&o.length&&(n=o[0],a&&await n._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==n)try{await e._remove(s)}catch{}}))),new es(n,e,r)}}function ea(e){let t=e.toLowerCase();if(t.includes(\\"opera/\\")||t.includes(\\"opr/\\")||t.includes(\\"opios/\\"))return\\"Opera\\";{if(eh(t))return\\"IEMobile\\";if(t.includes(\\"msie\\")||t.includes(\\"trident/\\"))return\\"IE\\";if(t.includes(\\"edge/\\"))return\\"Edge\\";if(eo(t))return\\"Firefox\\";if(t.includes(\\"silk/\\"))return\\"Silk\\";if(ed(t))return\\"Blackberry\\";if(ef(t))return\\"Webos\\";if(el(t))return\\"Safari\\";if((t.includes(\\"chrome/\\")||eu(t))&&!t.includes(\\"edge/\\"))return\\"Chrome\\";if(ec(t))return\\"Android\\";let r=e.match(/([a-zA-Z\\\\d\\\\.]+)\\\\/[a-zA-Z\\\\d\\\\.]*$/);if(r?.length===2)return r[1]}return\\"Other\\"}function eo(e=(0,s.ZQ)()){return/firefox\\\\//i.test(e)}function el(e=(0,s.ZQ)()){let t=e.toLowerCase();return t.includes(\\"safari/\\")&&!t.includes(\\"chrome/\\")&&!t.includes(\\"crios/\\")&&!t.includes(\\"android\\")}function eu(e=(0,s.ZQ)()){return/crios\\\\//i.test(e)}function eh(e=(0,s.ZQ)()){return/iemobile/i.test(e)}function ec(e=(0,s.ZQ)()){return/android/i.test(e)}function ed(e=(0,s.ZQ)()){return/blackberry/i.test(e)}function ef(e=(0,s.ZQ)()){return/webos/i.test(e)}function ep(e=(0,s.ZQ)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function eg(e=(0,s.ZQ)()){return ep(e)||ec(e)||ef(e)||ed(e)||/windows phone/i.test(e)||eh(e)}function em(e,t=[]){let r;switch(e){case\\"Browser\\":r=ea((0,s.ZQ)());break;case\\"Worker\\":r=`${ea((0,s.ZQ)())}-${e}`;break;default:r=e}let i=t.length?t.join(\\",\\"):\\"FirebaseCore-web\\";return`${r}/JsCore/${n.MF}/${i}`}class ey{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=t=>new Promise((r,i)=>{try{let i=e(t);r(i)}catch(e){i(e)}});r.onAbort=t,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(e){for(let e of(t.reverse(),t))try{e()}catch(e){}throw this.auth._errorFactory.create(\\"login-blocked\\",{originalMessage:e?.message})}}}async function ev(e,t={}){return k(e,\\"GET\\",\\"/v2/passwordPolicy\\",A(e,t))}class ew{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,\\"ENFORCEMENT_STATE_UNSPECIFIED\\"===this.enforcementState&&(this.enforcementState=\\"OFF\\"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join(\\"\\")??\\"\\",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let r;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i=\\"a\\"&&r<=\\"z\\",r>=\\"A\\"&&r<=\\"Z\\",r>=\\"0\\"&&r<=\\"9\\",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,n){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=n))}}class eb{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eE(this),this.idTokenSubscription=new eE(this),this.beforeStateQueue=new ey(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=u,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=er(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){if(this.persistenceManager=await es.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(this.currentUser||e){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await F(this,{idToken:e}),r=await ee._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(e){console.warn(\\"FirebaseServerApp could not login user with provided authIdToken: \\",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if((0,n.xZ)(this.app)){let e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}let t=await this.assertedPersistence.getCurrentUser(),r=t,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let t=this.redirectUser?._redirectEventId,n=r?._redirectEventId,s=await this.tryRedirectSignIn(e);(!t||t===n)&&s?.user&&(r=s.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return(y(this._popupRedirectResolver,this,\\"argument-error\\"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId)?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await G(e)}catch(e){if(e?.code!==\\"auth/network-request-failed\\")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if(\\"undefined\\"==typeof navigator)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if((0,n.xZ)(this.app))return Promise.reject(g(this));let t=e?(0,s.Ku)(e):null;return t&&y(t.auth.config.apiKey===this.config.apiKey,this,\\"invalid-user-token\\"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&y(this.tenantId===e.tenantId,this,\\"tenant-id-mismatch\\"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return(0,n.xZ)(this.app)?Promise.reject(g(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,n.xZ)(this.app)?Promise.reject(g(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(er(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create(\\"unsupported-password-policy-schema-version\\",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=new ew(await ev(this));null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new s.FA(\\"auth\\",\\"Firebase\\",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t={providerId:\\"apple.com\\",tokenType:\\"ACCESS_TOKEN\\",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await X(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){let r=await this.getOrInitRedirectPersistenceManager(t);return null===e?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&er(e)||this._popupRedirectResolver;y(t,this,\\"argument-error\\"),this.redirectPersistenceManager=await es.create(this,[er(t._redirectPersistence)],\\"redirectUser\\"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return(this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e)?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};let n=\\"function\\"==typeof t?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(y(a,this,\\"internal-error\\"),a.then(()=>{s||n(this.currentUser)}),\\"function\\"==typeof t){let n=e.addObserver(t,r,i);return()=>{s=!0,n()}}{let r=e.addObserver(t);return()=>{s=!0,r()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return y(this.persistenceManager,this,\\"internal-error\\"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=em(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={\\"X-Client-Version\\":this.clientVersion};this.app.options.appId&&(e[\\"X-Firebase-gmpid\\"]=this.app.options.appId);let t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e[\\"X-Firebase-Client\\"]=t);let r=await this._getAppCheckToken();return r&&(e[\\"X-Firebase-AppCheck\\"]=r),e}async _getAppCheckToken(){if((0,n.xZ)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&function(e,...t){h.logLevel<=a.$b.WARN&&h.warn(`Auth (${n.MF}): ${e}`,...t)}(`Error while retrieving App Check token: ${e.error}`),e?.token}}function e_(e){return(0,s.Ku)(e)}class eE{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,s.tD)(e=>this.observer=e)}get next(){return y(this.observer,this.auth,\\"internal-error\\"),this.observer.next.bind(this.observer)}}let eI={async loadJS(){throw Error(\\"Unable to load external scripts\\")},recaptchaV2Script:\\"\\",recaptchaEnterpriseScript:\\"\\",gapiScript:\\"\\"};function eT(e){return`__${e}${Math.floor(1e6*Math.random())}`}class eS{constructor(){this.enterprise=new eC}ready(e){e()}execute(e,t){return Promise.resolve(\\"token\\")}render(e,t){return\\"\\"}}class eC{ready(e){e()}execute(e,t){return Promise.resolve(\\"token\\")}render(e,t){return\\"\\"}}let eA=\\"NO_RECAPTCHA\\";class ek{constructor(e){this.type=\\"recaptcha-enterprise\\",this.auth=e_(e)}async verify(e=\\"verify\\",t=!1){async function r(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,r)=>{M(e,{clientType:\\"CLIENT_TYPE_WEB\\",version:\\"RECAPTCHA_ENTERPRISE\\"}).then(i=>{if(void 0===i.recaptchaKey)r(Error(\\"recaptcha Enterprise site key undefined\\"));else{let r=new L(i);return null==e.tenantId?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,t(r.siteKey)}}).catch(e=>{r(e)})})}function i(t,r,i){let n=window.grecaptcha;x(n)?n.enterprise.ready(()=>{n.enterprise.execute(t,{action:e}).then(e=>{r(e)}).catch(()=>{r(eA)})}):i(Error(\\"No reCAPTCHA enterprise script loaded.\\"))}return this.auth.settings.appVerificationDisabledForTesting?new eS().execute(\\"siteKey\\",{action:\\"verify\\"}):new Promise((e,n)=>{r(this.auth).then(r=>{if(!t&&x(window.grecaptcha))i(r,e,n);else{var s;if(\\"undefined\\"==typeof window)return void n(Error(\\"RecaptchaVerifier is only supported in browser\\"));let t=eI.recaptchaEnterpriseScript;0!==t.length&&(t+=r),(s=t,eI.loadJS(s)).then(()=>{i(r,e,n)}).catch(e=>{n(e)})}}).catch(e=>{n(e)})})}}async function eR(e,t,r,i=!1,n=!1){let s,a=new ek(e);if(n)s=eA;else try{s=await a.verify(r)}catch(e){s=await a.verify(r,!0)}let o={...t};if(\\"mfaSmsEnrollment\\"===r||\\"mfaSmsSignIn\\"===r){if(\\"phoneEnrollmentInfo\\"in o){let e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:s,clientType:\\"CLIENT_TYPE_WEB\\",recaptchaVersion:\\"RECAPTCHA_ENTERPRISE\\"}})}else if(\\"phoneSignInInfo\\"in o){let e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:s,clientType:\\"CLIENT_TYPE_WEB\\",recaptchaVersion:\\"RECAPTCHA_ENTERPRISE\\"}})}return o}return i?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:\\"CLIENT_TYPE_WEB\\"}),Object.assign(o,{recaptchaVersion:\\"RECAPTCHA_ENTERPRISE\\"}),o}async function eN(e,t,r,i,n){if(\\"EMAIL_PASSWORD_PROVIDER\\"===n)if(!e._getRecaptchaConfig()?.isProviderEnabled(\\"EMAIL_PASSWORD_PROVIDER\\"))return i(e,t).catch(async n=>{if(\\"auth/missing-recaptcha-token\\"!==n.code)return Promise.reject(n);{console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let n=await eR(e,t,r,\\"getOobCode\\"===r);return i(e,n)}});else{let n=await eR(e,t,r,\\"getOobCode\\"===r);return i(e,n)}if(\\"PHONE_PROVIDER\\"!==n)return Promise.reject(n+\\" provider is not supported.\\");if(e._getRecaptchaConfig()?.isProviderEnabled(\\"PHONE_PROVIDER\\")){let n=await eR(e,t,r);return i(e,n).catch(async n=>{if(e._getRecaptchaConfig()?.getProviderEnforcementState(\\"PHONE_PROVIDER\\")===\\"AUDIT\\"&&(\\"auth/missing-recaptcha-token\\"===n.code||\\"auth/invalid-app-credential\\"===n.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${r} flow.`);let n=await eR(e,t,r,!1,!0);return i(e,n)}return Promise.reject(n)})}{let n=await eR(e,t,r,!1,!0);return i(e,n)}}async function eO(e){let t=e_(e),r=new L(await M(t,{clientType:\\"CLIENT_TYPE_WEB\\",version:\\"RECAPTCHA_ENTERPRISE\\"}));null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()&&new ek(t).verify()}function eP(e){let t=e.indexOf(\\":\\");return t<0?\\"\\":e.substr(0,t+1)}function eD(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}class ex{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return v(\\"not implemented\\")}_getIdTokenResponse(e){return v(\\"not implemented\\")}_linkToIdToken(e,t){return v(\\"not implemented\\")}_getReauthenticationResolver(e){return v(\\"not implemented\\")}}async function eL(e,t){return k(e,\\"POST\\",\\"/v1/accounts:signUp\\",t)}async function eM(e,t){return N(e,\\"POST\\",\\"/v1/accounts:signInWithPassword\\",A(e,t))}async function eU(e,t){return N(e,\\"POST\\",\\"/v1/accounts:signInWithEmailLink\\",A(e,t))}async function eF(e,t){return N(e,\\"POST\\",\\"/v1/accounts:signInWithEmailLink\\",A(e,t))}class eV extends ex{constructor(e,t,r,i=null){super(\\"password\\",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new eV(e,t,\\"password\\")}static _fromEmailAndCode(e,t,r=null){return new eV(e,t,\\"emailLink\\",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=\\"string\\"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if(\\"password\\"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);else if(\\"emailLink\\"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case\\"password\\":return eN(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:\\"CLIENT_TYPE_WEB\\"},\\"signInWithPassword\\",eM,\\"EMAIL_PASSWORD_PROVIDER\\");case\\"emailLink\\":return eU(e,{email:this._email,oobCode:this._password});default:d(e,\\"internal-error\\")}}async _linkToIdToken(e,t){switch(this.signInMethod){case\\"password\\":return eN(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:\\"CLIENT_TYPE_WEB\\"},\\"signUpPassword\\",eL,\\"EMAIL_PASSWORD_PROVIDER\\");case\\"emailLink\\":return eF(e,{idToken:t,email:this._email,oobCode:this._password});default:d(e,\\"internal-error\\")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function ej(e,t){return N(e,\\"POST\\",\\"/v1/accounts:signInWithIdp\\",A(e,t))}class eq extends ex{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new eq(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):d(\\"argument-error\\"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let{providerId:t,signInMethod:r,...i}=\\"string\\"==typeof e?JSON.parse(e):e;if(!t||!r)return null;let n=new eq(t,r);return n.idToken=i.idToken||void 0,n.accessToken=i.accessToken||void 0,n.secret=i.secret,n.nonce=i.nonce,n.pendingToken=i.pendingToken||null,n}_getIdTokenResponse(e){return ej(e,this.buildRequest())}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,ej(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,ej(e,t)}buildRequest(){let e={requestUri:\\"http://localhost\\",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,s.Am)(t)}return e}}async function eB(e,t){return k(e,\\"POST\\",\\"/v1/accounts:sendVerificationCode\\",A(e,t))}async function e$(e,t){return N(e,\\"POST\\",\\"/v1/accounts:signInWithPhoneNumber\\",A(e,t))}async function ez(e,t){let r=await N(e,\\"POST\\",\\"/v1/accounts:signInWithPhoneNumber\\",A(e,t));if(r.temporaryProof)throw D(e,\\"account-exists-with-different-credential\\",r);return r}let eH={USER_NOT_FOUND:\\"user-not-found\\"};async function eK(e,t){return N(e,\\"POST\\",\\"/v1/accounts:signInWithPhoneNumber\\",A(e,{...t,operation:\\"REAUTH\\"}),eH)}class eG extends ex{constructor(e){super(\\"phone\\",\\"phone\\"),this.params=e}static _fromVerification(e,t){return new eG({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new eG({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return e$(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return ez(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return eK(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:i}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){\\"string\\"==typeof e&&(e=JSON.parse(e));let{verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:n}=e;return r||t||i||n?new eG({verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:n}):null}}class eQ{constructor(e){const t=(0,s.I9)((0,s.hp)(e)),r=t.apiKey??null,i=t.oobCode??null,n=function(e){switch(e){case\\"recoverEmail\\":return\\"RECOVER_EMAIL\\";case\\"resetPassword\\":return\\"PASSWORD_RESET\\";case\\"signIn\\":return\\"EMAIL_SIGNIN\\";case\\"verifyEmail\\":return\\"VERIFY_EMAIL\\";case\\"verifyAndChangeEmail\\":return\\"VERIFY_AND_CHANGE_EMAIL\\";case\\"revertSecondFactorAddition\\":return\\"REVERT_SECOND_FACTOR_ADDITION\\";default:return null}}(t.mode??null);y(r&&i&&n,\\"argument-error\\"),this.apiKey=r,this.operation=n,this.code=i,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){let t,r,i,n=(r=(t=(0,s.I9)((0,s.hp)(e)).link)?(0,s.I9)((0,s.hp)(t)).deep_link_id:null,((i=(0,s.I9)((0,s.hp)(e)).deep_link_id)?(0,s.I9)((0,s.hp)(i)).link:null)||i||r||t||e);try{return new eQ(n)}catch{return null}}}class eW{constructor(){this.providerId=eW.PROVIDER_ID}static credential(e,t){return eV._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let r=eQ.parseLink(t);return y(r,\\"argument-error\\"),eV._fromEmailAndCode(e,r.code,r.tenantId)}}eW.PROVIDER_ID=\\"password\\",eW.EMAIL_PASSWORD_SIGN_IN_METHOD=\\"password\\",eW.EMAIL_LINK_SIGN_IN_METHOD=\\"emailLink\\";class eJ{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class eX extends eJ{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class eY extends eX{constructor(){super(\\"facebook.com\\")}static credential(e){return eq._fromParams({providerId:eY.PROVIDER_ID,signInMethod:eY.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return eY.credentialFromTaggedObject(e)}static credentialFromError(e){return eY.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!(\\"oauthAccessToken\\"in e)||!e.oauthAccessToken)return null;try{return eY.credential(e.oauthAccessToken)}catch{return null}}}eY.FACEBOOK_SIGN_IN_METHOD=\\"facebook.com\\",eY.PROVIDER_ID=\\"facebook.com\\";class eZ extends eX{constructor(){super(\\"google.com\\"),this.addScope(\\"profile\\")}static credential(e,t){return eq._fromParams({providerId:eZ.PROVIDER_ID,signInMethod:eZ.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return eZ.credentialFromTaggedObject(e)}static credentialFromError(e){return eZ.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return eZ.credential(t,r)}catch{return null}}}eZ.GOOGLE_SIGN_IN_METHOD=\\"google.com\\",eZ.PROVIDER_ID=\\"google.com\\";class e0 extends eX{constructor(){super(\\"github.com\\")}static credential(e){return eq._fromParams({providerId:e0.PROVIDER_ID,signInMethod:e0.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return e0.credentialFromTaggedObject(e)}static credentialFromError(e){return e0.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!(\\"oauthAccessToken\\"in e)||!e.oauthAccessToken)return null;try{return e0.credential(e.oauthAccessToken)}catch{return null}}}e0.GITHUB_SIGN_IN_METHOD=\\"github.com\\",e0.PROVIDER_ID=\\"github.com\\";class e1 extends eX{constructor(){super(\\"twitter.com\\")}static credential(e,t){return eq._fromParams({providerId:e1.PROVIDER_ID,signInMethod:e1.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return e1.credentialFromTaggedObject(e)}static credentialFromError(e){return e1.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return e1.credential(t,r)}catch{return null}}}e1.TWITTER_SIGN_IN_METHOD=\\"twitter.com\\",e1.PROVIDER_ID=\\"twitter.com\\";class e2{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){return new e2({user:await ee._fromIdTokenResponse(e,r,i),providerId:e6(r),_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){return await e._updateTokensIfNecessary(r,!0),new e2({user:e,providerId:e6(r),_tokenResponse:r,operationType:t})}}function e6(e){return e.providerId?e.providerId:\\"phoneNumber\\"in e?\\"phone\\":null}class e3 extends s.g{constructor(e,t,r,i){super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,e3.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new e3(e,t,r,i)}}function e5(e,t,r,i){return(\\"reauthenticate\\"===t?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(r=>{if(\\"auth/multi-factor-auth-required\\"===r.code)throw e3._fromErrorAndOperation(e,r,t,i);throw r})}async function e4(e,t,r=!1){let i=await z(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return e2._forOperation(e,\\"link\\",i)}async function e8(e,t,r=!1){let{auth:i}=e;if((0,n.xZ)(i.app))return Promise.reject(g(i));let s=\\"reauthenticate\\";try{let n=await z(e,e5(i,s,t,e),r);y(n.idToken,i,\\"internal-error\\");let a=B(n.idToken);y(a,i,\\"internal-error\\");let{sub:o}=a;return y(e.uid===o,i,\\"user-mismatch\\"),e2._forOperation(e,s,n)}catch(e){throw e?.code===\\"auth/user-not-found\\"&&d(i,\\"user-mismatch\\"),e}}async function e7(e,t,r=!1){if((0,n.xZ)(e.app))return Promise.reject(g(e));let i=\\"signIn\\",s=await e5(e,i,t),a=await e2._fromIdTokenResponse(e,i,s);return r||await e._updateCurrentUser(a.user),a}async function e9(e,t){return e7(e_(e),t)}class te{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return\\"phoneInfo\\"in t?tt._fromServerResponse(e,t):\\"totpInfo\\"in t?tr._fromServerResponse(e,t):d(e,\\"internal-error\\")}}class tt extends te{constructor(e){super(\\"phone\\",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new tt(t)}}class tr extends te{constructor(e){super(\\"totp\\",e)}static _fromServerResponse(e,t){return new tr(t)}}async function ti(e){let t=e_(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}function tn(e,t,r){return(0,n.xZ)(e.app)?Promise.reject(g(e)):e9((0,s.Ku)(e),eW.credential(t,r)).catch(async t=>{throw\\"auth/password-does-not-meet-requirements\\"===t.code&&ti(e),t})}function ts(e,t,r,i){return(0,s.Ku)(e).onAuthStateChanged(t,r,i)}function ta(e,t){return k(e,\\"POST\\",\\"/v2/accounts/mfaEnrollment:start\\",A(e,t))}new WeakMap;let to=\\"__sak\\";class tl{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(to,\\"1\\"),this.storage.removeItem(to),Promise.resolve(!0)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class tu extends tl{constructor(){super(()=>window.localStorage,\\"LOCAL\\"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=eg(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,r)=>{this.notifyListeners(e,r)});let r=e.key;t?this.detachListener():this.stopPolling();let i=()=>{let e=this.storage.getItem(r);(t||this.localCache[r]!==e)&&this.notifyListeners(r,e)},n=this.storage.getItem(r);(0,s.lT)()&&10===document.documentMode&&n!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,10):i()}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent(\\"storage\\",{key:e,oldValue:t,newValue:r}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener(\\"storage\\",this.boundEventHandler)}detachListener(){window.removeEventListener(\\"storage\\",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}function th(e){let t=e.replace(/[\\\\\\\\^$.*+?()[\\\\]{}|]/g,\\"\\\\\\\\$&\\"),r=RegExp(`${t}=([^;]+)`);return document.cookie.match(r)?.[1]??null}function tc(e){let t=\\"http:\\"===window.location.protocol;return`${t?\\"__dev_\\":\\"__HOST-\\"}FIREBASE_${e.split(\\":\\")[3]}`}tu.type=\\"LOCAL\\";class td{constructor(){this.type=\\"COOKIE\\",this.listenerUnsubscribes=new Map}_getFinalTarget(e){let t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set(\\"finalTarget\\",e),t}async _isAvailable(){return(\\"boolean\\"!=typeof isSecureContext||!!isSecureContext)&&\\"undefined\\"!=typeof navigator&&\\"undefined\\"!=typeof document&&(navigator.cookieEnabled??!0)}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;let t=tc(e);if(window.cookieStore){let e=await window.cookieStore.get(t);return e?.value}return th(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let t=tc(e);document.cookie=`${t}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch(\\"/__cookies__\\",{method:\\"DELETE\\"}).catch(()=>void 0)}_addListener(e,t){if(!this._isAvailable())return;let r=tc(e);if(window.cookieStore){let e=e=>{let i=e.changed.find(e=>e.name===r);i&&t(i.value),e.deleted.find(e=>e.name===r)&&t(null)};return this.listenerUnsubscribes.set(t,()=>window.cookieStore.removeEventListener(\\"change\\",e)),window.cookieStore.addEventListener(\\"change\\",e)}let i=th(r),n=setInterval(()=>{let e=th(r);e!==i&&(t(e),i=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(n))}_removeListener(e,t){let r=this.listenerUnsubscribes.get(t);r&&(r(),this.listenerUnsubscribes.delete(t))}}td.type=\\"COOKIE\\";class tf extends tl{constructor(){super(()=>window.sessionStorage,\\"SESSION\\")}_addListener(e,t){}_removeListener(e,t){}}tf.type=\\"SESSION\\";class tp{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;let r=new tp(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:r,data:i}=e.data,n=this.handlersMap[r];if(!n?.size)return;e.ports[0].postMessage({status:\\"ack\\",eventId:t,eventType:r});let s=Array.from(n).map(async t=>t(e.origin,i)),a=await Promise.all(s.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:\\"done\\",eventId:t,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener(\\"message\\",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener(\\"message\\",this.boundEventHandler)}}function tg(e=\\"\\",t=10){let r=\\"\\";for(let e=0;e{let l=tg(\\"\\",20);s.port1.start();let u=setTimeout(()=>{o(Error(\\"unsupported_event\\"))},r);n={messageChannel:s,onMessage(e){if(e.data.eventId===l)switch(e.data.status){case\\"ack\\":clearTimeout(u),i=setTimeout(()=>{o(Error(\\"timeout\\"))},3e3);break;case\\"done\\":clearTimeout(i),a(e.data.response);break;default:clearTimeout(u),clearTimeout(i),o(Error(\\"invalid_response\\"))}}},this.handlers.add(n),s.port1.addEventListener(\\"message\\",n.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[s.port2])}).finally(()=>{n&&this.removeMessageHandler(n)})}}function ty(){return window}function tv(){return void 0!==ty().WorkerGlobalScope&&\\"function\\"==typeof ty().importScripts}async function tw(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}let tb=\\"firebaseLocalStorageDb\\",t_=\\"firebaseLocalStorage\\",tE=\\"fbase_key\\";class tI{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener(\\"success\\",()=>{e(this.request.result)}),this.request.addEventListener(\\"error\\",()=>{t(this.request.error)})})}}function tT(e,t){return e.transaction([t_],t?\\"readwrite\\":\\"readonly\\").objectStore(t_)}function tS(){let e=indexedDB.open(tb,1);return new Promise((t,r)=>{e.addEventListener(\\"error\\",()=>{r(e.error)}),e.addEventListener(\\"upgradeneeded\\",()=>{let t=e.result;try{t.createObjectStore(t_,{keyPath:tE})}catch(e){r(e)}}),e.addEventListener(\\"success\\",async()=>{let r=e.result;r.objectStoreNames.contains(t_)?t(r):(r.close(),await new tI(indexedDB.deleteDatabase(tb)).toPromise(),t(await tS()))})})}async function tC(e,t,r){return new tI(tT(e,!0).put({[tE]:t,value:r})).toPromise()}async function tA(e,t){let r=tT(e,!1).get(t),i=await new tI(r).toPromise();return void 0===i?null:i.value}function tk(e,t){return new tI(tT(e,!0).delete(t)).toPromise()}class tR{constructor(){this.type=\\"LOCAL\\",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await tS()),this.db}async _withRetries(e){let t=0;for(;;)try{let t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return tv()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=tp._getInstance(tv()?self:null),this.receiver._subscribe(\\"keyChanged\\",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe(\\"ping\\",async(e,t)=>[\\"keyChanged\\"])}async initializeSender(){if(this.activeServiceWorker=await tw(),!this.activeServiceWorker)return;this.sender=new tm(this.activeServiceWorker);let e=await this.sender._send(\\"ping\\",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes(\\"keyChanged\\")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send(\\"keyChanged\\",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await tS();return await tC(e,to,\\"1\\"),await tk(e,to),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>tC(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>tA(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>tk(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new tI(tT(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],r=new Set;if(0!==e.length)for(let{fbase_key:i,value:n}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(n)&&(this.notifyListeners(i,n),t.push(i));for(let e of Object.keys(this.localCache))this.localCache[e]&&!r.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}function tN(e,t){return k(e,\\"POST\\",\\"/v2/accounts/mfaSignIn:start\\",A(e,t))}tR.type=\\"LOCAL\\",eT(\\"rcb\\"),new _(3e4,6e4);let tO=\\"recaptcha\\";async function tP(e,t,r){if(!e._getRecaptchaConfig())try{await eO(e)}catch(e){console.log(\\"Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.\\")}try{let i;if(i=\\"string\\"==typeof t?{phoneNumber:t}:t,\\"session\\"in i){let t=i.session;if(\\"phoneNumber\\"in i){y(\\"enroll\\"===t.type,e,\\"internal-error\\");let n={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:i.phoneNumber,clientType:\\"CLIENT_TYPE_WEB\\"}},s=async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===eA){y(r?.type===tO,e,\\"argument-error\\");let i=await tD(e,t,r);return ta(e,i)}return ta(e,t)},a=eN(e,n,\\"mfaSmsEnrollment\\",s,\\"PHONE_PROVIDER\\");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{y(\\"signin\\"===t.type,e,\\"internal-error\\");let n=i.multiFactorHint?.uid||i.multiFactorUid;y(n,e,\\"missing-multi-factor-info\\");let s={mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{clientType:\\"CLIENT_TYPE_WEB\\"}},a=async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===eA){y(r?.type===tO,e,\\"argument-error\\");let i=await tD(e,t,r);return tN(e,i)}return tN(e,t)},o=eN(e,s,\\"mfaSmsSignIn\\",a,\\"PHONE_PROVIDER\\");return(await o.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{let t={phoneNumber:i.phoneNumber,clientType:\\"CLIENT_TYPE_WEB\\"},n=async(e,t)=>{if(t.captchaResponse===eA){y(r?.type===tO,e,\\"argument-error\\");let i=await tD(e,t,r);return eB(e,i)}return eB(e,t)},s=eN(e,t,\\"sendVerificationCode\\",n,\\"PHONE_PROVIDER\\");return(await s.catch(e=>Promise.reject(e))).sessionInfo}}finally{r?._reset()}}async function tD(e,t,r){y(r.type===tO,e,\\"argument-error\\");let i=await r.verify();y(\\"string\\"==typeof i,e,\\"argument-error\\");let n={...t};if(\\"phoneEnrollmentInfo\\"in n){let e=n.phoneEnrollmentInfo.phoneNumber,t=n.phoneEnrollmentInfo.captchaResponse,r=n.phoneEnrollmentInfo.clientType,s=n.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(n,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:i,captchaResponse:t,clientType:r,recaptchaVersion:s}}),n}if(!(\\"phoneSignInInfo\\"in n))return Object.assign(n,{recaptchaToken:i}),n;{let e=n.phoneSignInInfo.captchaResponse,t=n.phoneSignInInfo.clientType,r=n.phoneSignInInfo.recaptchaVersion;return Object.assign(n,{phoneSignInInfo:{recaptchaToken:i,captchaResponse:e,clientType:t,recaptchaVersion:r}}),n}}class tx{constructor(e){this.providerId=tx.PROVIDER_ID,this.auth=e_(e)}verifyPhoneNumber(e,t){return tP(this.auth,e,(0,s.Ku)(t))}static credential(e,t){return eG._fromVerification(e,t)}static credentialFromResult(e){return tx.credentialFromTaggedObject(e)}static credentialFromError(e){return tx.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:r}=e;return t&&r?eG._fromTokenResponse(t,r):null}}tx.PROVIDER_ID=\\"phone\\",tx.PHONE_SIGN_IN_METHOD=\\"phone\\";class tL extends ex{constructor(e){super(\\"custom\\",\\"custom\\"),this.params=e}_getIdTokenResponse(e){return ej(e,this._buildIdpRequest())}_linkToIdToken(e,t){return ej(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return ej(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function tM(e){return e7(e.auth,new tL(e),e.bypassAuthState)}function tU(e){let{auth:t,user:r}=e;return y(r,t,\\"internal-error\\"),e8(r,new tL(e),e.bypassAuthState)}async function tF(e){let{auth:t,user:r}=e;return y(r,t,\\"internal-error\\"),e4(r,new tL(e),e.bypassAuthState)}class tV{constructor(e,t,r,i,n=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=n,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:r,postBody:i,tenantId:n,error:s,type:a}=e;if(s)return void this.reject(s);let o={auth:this.auth,requestUri:t,sessionId:r,tenantId:n||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case\\"signInViaPopup\\":case\\"signInViaRedirect\\":return tM;case\\"linkViaPopup\\":case\\"linkViaRedirect\\":return tF;case\\"reauthViaPopup\\":case\\"reauthViaRedirect\\":return tU;default:d(this.auth,\\"internal-error\\")}}resolve(e){var t,r;t=this.pendingPromise,r=\\"Pending promise was never set\\",t||v(r),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){var t,r;t=this.pendingPromise,r=\\"Pending promise was never set\\",t||v(r),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}let tj=new _(2e3,1e4);class tq extends tV{constructor(e,t,r,i,n){super(e,t,i,n),this.provider=r,this.authWindow=null,this.pollId=null,tq.currentPopupAction&&tq.currentPopupAction.cancel(),tq.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return y(e,this.auth,\\"internal-error\\"),e}async onExecution(){var e,t;e=1===this.filter.length,t=\\"Popup operations only handle one event\\",e||v(t);let r=tg();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],r),this.authWindow.associatedEvent=r,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(f(this.auth,\\"web-storage-unsupported\\"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(f(this.auth,\\"cancelled-popup-request\\"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,tq.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(f(this.auth,\\"popup-closed-by-user\\"))},8e3);return}this.pollId=window.setTimeout(e,tj.get())};e()}}tq.currentPopupAction=null;let tB=new Map;class t$ extends tV{constructor(e,t,r=!1){super(e,[\\"signInViaRedirect\\",\\"linkViaRedirect\\",\\"reauthViaRedirect\\",\\"unknown\\"],t,void 0,r),this.eventId=null}async execute(){let e=tB.get(this.auth._key());if(!e){try{let t=await tz(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}tB.set(this.auth._key(),e)}return this.bypassAuthState||tB.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(\\"signInViaRedirect\\"===e.type)return super.onAuthEvent(e);if(\\"unknown\\"===e.type)return void this.resolve(null);if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function tz(e,t){var r;let i=en(\\"pendingRedirect\\",(r=t).config.apiKey,r.name),n=er(e._redirectPersistence);if(!await n._isAvailable())return!1;let s=await n._get(i)===\\"true\\";return await n._remove(i),s}function tH(e,t){tB.set(e._key(),t)}async function tK(e,t,r=!1){if((0,n.xZ)(e.app))return Promise.reject(g(e));let i=e_(e),s=t?er(t):(y(i._popupRedirectResolver,i,\\"argument-error\\"),i._popupRedirectResolver),a=new t$(i,s,r),o=await a.execute();return o&&!r&&(delete o.user._redirectEventId,await i._persistUserIfCurrent(o.user),await i._setRedirectUser(null,t)),o}class tG{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case\\"signInViaRedirect\\":case\\"linkViaRedirect\\":case\\"reauthViaRedirect\\":return!0;case\\"unknown\\":return tW(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!tW(e)){let r=e.error.code?.split(\\"auth/\\")[1]||\\"internal-error\\";t.onError(f(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let r=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(tQ(e))}saveEventToCache(e){this.cachedEventUids.add(tQ(e)),this.lastProcessedEventTime=Date.now()}}function tQ(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join(\\"-\\")}function tW({type:e,error:t}){return\\"unknown\\"===e&&t?.code===\\"auth/no-auth-event\\"}async function tJ(e,t={}){return k(e,\\"GET\\",\\"/v1/projects\\",t)}let tX=/^\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}$/,tY=/^https?/;async function tZ(e){if(e.config.emulator)return;let{authorizedDomains:t}=await tJ(e);for(let e of t)try{if(function(e){let t=w(),{protocol:r,hostname:i}=new URL(t);if(e.startsWith(\\"chrome-extension://\\")){let n=new URL(e);return\\"\\"===n.hostname&&\\"\\"===i?\\"chrome-extension:\\"===r&&e.replace(\\"chrome-extension://\\",\\"\\")===t.replace(\\"chrome-extension://\\",\\"\\"):\\"chrome-extension:\\"===r&&n.hostname===i}if(!tY.test(r))return!1;if(tX.test(e))return i===e;let n=e.replace(/\\\\./g,\\"\\\\\\\\.\\");return RegExp(\\"^(.+\\\\\\\\.\\"+n+\\"|\\"+n+\\")$\\",\\"i\\").test(i)}(e))return}catch{}d(e,\\"unauthorized-domain\\")}let t0=new _(3e4,6e4);function t1(){let e=ty().___jsl;if(e?.H){for(let t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t{function i(){t1(),gapi.load(\\"gapi.iframes\\",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{t1(),r(f(e,\\"network-request-failed\\"))},timeout:t0.get()})}if(ty().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else if(ty().gapi?.load)i();else{var n;let t=eT(\\"iframefcb\\");return ty()[t]=()=>{gapi.load?i():r(f(e,\\"network-request-failed\\"))},(n=`${eI.gapiScript}?onload=${t}`,eI.loadJS(n)).catch(e=>r(e))}}).catch(e=>{throw t2=null,e})),u=ty().gapi;return y(u,e,\\"internal-error\\"),l.open({where:document.body,url:(y((t=e.config).authDomain,e,\\"auth-domain-config-required\\"),r=t.emulator?E(t,\\"emulator/auth/iframe\\"):`https://${e.config.authDomain}/__/auth/iframe`,i={apiKey:t.apiKey,appName:e.name,v:n.MF},(a=t5.get(e.config.apiHost))&&(i.eid=a),(o=e._getFrameworks()).length&&(i.fw=o.join(\\",\\")),`${r}?${(0,s.Am)(i).slice(1)}`),messageHandlersFilter:u.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:t3,dontclear:!0},t=>new Promise(async(r,i)=>{await t.restyle({setHideOnLeave:!1});let n=f(e,\\"network-request-failed\\"),s=ty().setTimeout(()=>{i(n)},t6.get());function a(){ty().clearTimeout(s),r(t)}t.ping(a).then(a,()=>{i(n)})}))}let t8={location:\\"yes\\",resizable:\\"yes\\",statusbar:\\"yes\\",toolbar:\\"no\\"};class t7{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let t9=encodeURIComponent(\\"fac\\");async function re(e,t,r,i,a,o){y(e.config.authDomain,e,\\"auth-domain-config-required\\"),y(e.config.apiKey,e,\\"invalid-api-key\\");let l={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:i,v:n.MF,eventId:a};if(t instanceof eJ)for(let[r,i]of(t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||\\"\\",(0,s.Im)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(o||{})))l[r]=i;if(t instanceof eX){let e=t.getScopes().filter(e=>\\"\\"!==e);e.length>0&&(l.scopes=e.join(\\",\\"))}for(let t of(e.tenantId&&(l.tid=e.tenantId),Object.keys(l)))void 0===l[t]&&delete l[t];let u=await e._getAppCheckToken(),h=u?`#${t9}=${encodeURIComponent(u)}`:\\"\\";return`${function({config:e}){return e.emulator?E(e,\\"emulator/auth/handler\\"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,s.Am)(l).slice(1)}${h}`}let rt=\\"webStorageSupport\\";class rr{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=tf,this._completeRedirectFn=tK,this._overrideRedirectResult=tH}async _openPopup(e,t,r,i){var n,a;n=this.eventManagers[e._key()]?.manager,a=\\"_initialize() not called before _openPopup()\\",n||v(a);let o=await re(e,t,r,w(),i);return function(e,t,r,i=500,n=600){let a=Math.max((window.screen.availHeight-n)/2,0).toString(),o=Math.max((window.screen.availWidth-i)/2,0).toString(),l=\\"\\",u={...t8,width:i.toString(),height:n.toString(),top:a,left:o},h=(0,s.ZQ)().toLowerCase();r&&(l=eu(h)?\\"_blank\\":r),eo(h)&&(t=t||\\"http://localhost\\",u.scrollbars=\\"yes\\");let c=Object.entries(u).reduce((e,[t,r])=>`${e}${t}=${r},`,\\"\\");if(function(e=(0,s.ZQ)()){return ep(e)&&!!window.navigator?.standalone}(h)&&\\"_self\\"!==l){var d,f;let e,r;return d=t||\\"\\",f=l,(e=document.createElement(\\"a\\")).href=d,e.target=f,(r=document.createEvent(\\"MouseEvent\\")).initMouseEvent(\\"click\\",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),e.dispatchEvent(r),new t7(null)}let p=window.open(t||\\"\\",l,c);y(p,e,\\"popup-blocked\\");try{p.focus()}catch(e){}return new t7(p)}(e,o,tg())}async _openRedirect(e,t,r,i){var n;return await this._originValidation(e),n=await re(e,t,r,w(),i),ty().location.href=n,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){var r;let{manager:e,promise:i}=this.eventManagers[t];return e?Promise.resolve(e):(r=\\"If manager is not set, promise should be\\",i||v(r),i)}let i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){let t=await t4(e),r=new tG(e);return t.register(\\"authEvent\\",t=>(y(t?.authEvent,e,\\"invalid-auth-event\\"),{status:r.onEvent(t.authEvent)?\\"ACK\\":\\"ERROR\\"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(rt,{type:rt},r=>{let i=r?.[0]?.[rt];void 0!==i&&t(!!i),d(e,\\"internal-error\\")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=tZ(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return eg()||el()||ep()}}class ri{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case\\"enroll\\":return this._finalizeEnroll(e,t.credential,r);case\\"signin\\":return this._finalizeSignIn(e,t.credential);default:return v(\\"unexpected MultiFactorSessionType\\")}}}class rn extends ri{constructor(e){super(\\"phone\\"),this.credential=e}static _fromCredential(e){return new rn(e)}_finalizeEnroll(e,t,r){return k(e,\\"POST\\",\\"/v2/accounts/mfaEnrollment:finalize\\",A(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return k(e,\\"POST\\",\\"/v2/accounts/mfaSignIn:finalize\\",A(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class rs{constructor(){}static assertion(e){return rn._fromCredential(e)}}rs.FACTOR_ID=\\"phone\\";class ra{static assertionForEnrollment(e,t){return ro._fromSecret(e,t)}static assertionForSignIn(e,t){return ro._fromEnrollmentId(e,t)}static async generateSecret(e){var t;y(void 0!==e.user?.auth,\\"internal-error\\");let r=await k(t=e.user.auth,\\"POST\\",\\"/v2/accounts/mfaEnrollment:start\\",A(t,{idToken:e.credential,totpEnrollmentInfo:{}}));return rl._fromStartTotpMfaEnrollmentResponse(r,e.user.auth)}}ra.FACTOR_ID=\\"totp\\";class ro extends ri{constructor(e,t,r){super(\\"totp\\"),this.otp=e,this.enrollmentId=t,this.secret=r}static _fromSecret(e,t){return new ro(t,void 0,e)}static _fromEnrollmentId(e,t){return new ro(t,e)}async _finalizeEnroll(e,t,r){return y(void 0!==this.secret,e,\\"argument-error\\"),k(e,\\"POST\\",\\"/v2/accounts/mfaEnrollment:finalize\\",A(e,{idToken:t,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(e,t){y(void 0!==this.enrollmentId&&void 0!==this.otp,e,\\"argument-error\\");let r={verificationCode:this.otp};return k(e,\\"POST\\",\\"/v2/accounts/mfaSignIn:finalize\\",A(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r}))}}class rl{constructor(e,t,r,i,n,s,a){this.sessionInfo=s,this.auth=a,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=r,this.codeIntervalSeconds=i,this.enrollmentCompletionDeadline=n}static _fromStartTotpMfaEnrollmentResponse(e,t){return new rl(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){let r=!1;return(ru(e)||ru(t))&&(r=!0),r&&(ru(e)&&(e=this.auth.currentUser?.email||\\"unknownuser\\"),ru(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function ru(e){return void 0===e||e?.length===0}var rh=\\"@firebase/auth\\",rc=\\"1.12.0\\";class rd{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return(this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser)?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){y(this.auth._initializationPromise,\\"dependent-sdk-initialized-before-auth\\")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}let rf=(0,s.XA)(\\"authIdTokenMaxAge\\")||300,rp=null;function rg(e=(0,n.Sx)()){let t=(0,n.j6)(e,\\"auth\\");if(t.isInitialized())return t.getImmediate();let r=function(e,t){let r=(0,n.j6)(e,\\"auth\\");if(r.isInitialized()){let e=r.getImmediate(),i=r.getOptions();if((0,s.bD)(i,t??{}))return e;d(e,\\"already-initialized\\")}return r.initialize({options:t})}(e,{popupRedirectResolver:rr,persistence:[tR,tu,tf]}),i=(0,s.XA)(\\"authTokenSyncURL\\");if(i&&\\"boolean\\"==typeof isSecureContext&&isSecureContext){let e=new URL(i,location.origin);if(location.origin===e.origin){let t,i=(t=e.toString(),async e=>{let r=e&&await e.getIdTokenResult(),i=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(i&&i>rf)return;let n=r?.token;rp!==n&&(rp=n,await fetch(t,{method:n?\\"POST\\":\\"DELETE\\",headers:n?{Authorization:`Bearer ${n}`}:{}}))});(0,s.Ku)(r).beforeAuthStateChanged(i,()=>i(r.currentUser)),(0,s.Ku)(r).onIdTokenChanged(e=>i(e),void 0,void 0)}}let a=(0,s.Tj)(\\"auth\\");return a&&function(e,t,r){let i=e_(e);y(/^https?:\\\\/\\\\//.test(t),i,\\"invalid-emulator-scheme\\");let n=eP(t),{host:a,port:o}=function(e){let t=eP(e),r=/(\\\\/\\\\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:\\"\\",port:null};let i=r[2].split(\\"@\\").pop()||\\"\\",n=/^(\\\\[[^\\\\]]+\\\\])(:|$)/.exec(i);if(n){let e=n[1];return{host:e,port:eD(i.substr(e.length+1))}}{let[e,t]=i.split(\\":\\");return{host:e,port:eD(t)}}}(t),l=null===o?\\"\\":`:${o}`,u={url:`${n}//${a}${l}/`},h=Object.freeze({host:a,port:o,protocol:n.replace(\\":\\",\\"\\"),options:Object.freeze({disableWarnings:!1})});if(!i._canInitEmulator){y(i.config.emulator&&i.emulatorConfig,i,\\"emulator-config-failed\\"),y((0,s.bD)(u,i.config.emulator)&&(0,s.bD)(h,i.emulatorConfig),i,\\"emulator-config-failed\\");return}i.config.emulator=u,i.emulatorConfig=h,i.settings.appVerificationDisabledForTesting=!0,(0,s.zJ)(a)?((0,s.gE)(`${n}//${a}${l}`),(0,s.P1)(\\"Auth\\",!0)):function(){function e(){let e=document.createElement(\\"p\\"),t=e.style;e.innerText=\\"Running in emulator mode. Do not use with production credentials.\\",t.position=\\"fixed\\",t.width=\\"100%\\",t.backgroundColor=\\"#ffffff\\",t.border=\\".1em solid #000000\\",t.color=\\"#b50000\\",t.bottom=\\"0px\\",t.left=\\"0px\\",t.margin=\\"0px\\",t.zIndex=\\"10000\\",t.textAlign=\\"center\\",e.classList.add(\\"firebase-emulator-warning\\"),document.body.appendChild(e)}\\"undefined\\"!=typeof console&&\\"function\\"==typeof console.info&&console.info(\\"WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.\\"),\\"undefined\\"!=typeof window&&\\"undefined\\"!=typeof document&&(\\"loading\\"===document.readyState?window.addEventListener(\\"DOMContentLoaded\\",e):e())}()}(r,`http://${a}`),r}eI={loadJS:e=>new Promise((t,r)=>{let i=document.createElement(\\"script\\");i.setAttribute(\\"src\\",e),i.onload=t,i.onerror=e=>{let t=f(\\"internal-error\\");t.customData=e,r(t)},i.type=\\"text/javascript\\",i.charset=\\"UTF-8\\",(document.getElementsByTagName(\\"head\\")?.[0]??document).appendChild(i)}),gapiScript:\\"https://apis.google.com/js/api.js\\",recaptchaV2Script:\\"https://www.google.com/recaptcha/api.js\\",recaptchaEnterpriseScript:\\"https://www.google.com/recaptcha/enterprise.js?render=\\"},i=\\"Browser\\",(0,n.om)(new o.uA(\\"auth\\",(e,{options:t})=>{let r,n,s=e.getProvider(\\"app\\").getImmediate(),a=e.getProvider(\\"heartbeat\\"),o=e.getProvider(\\"app-check-internal\\"),{apiKey:l,authDomain:u}=s.options;y(l&&!l.includes(\\":\\"),\\"invalid-api-key\\",{appName:s.name});let h=new eb(s,a,o,{apiKey:l,authDomain:u,clientPlatform:i,apiHost:\\"identitytoolkit.googleapis.com\\",tokenApiHost:\\"securetoken.googleapis.com\\",apiScheme:\\"https\\",sdkClientVersion:em(i)});return n=(Array.isArray(r=t?.persistence||[])?r:[r]).map(er),t?.errorMap&&h._updateErrorMap(t.errorMap),h._initializeWithPersistence(n,t?.popupRedirectResolver),h},\\"PUBLIC\\").setInstantiationMode(\\"EXPLICIT\\").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(\\"auth-internal\\").initialize()})),(0,n.om)(new o.uA(\\"auth-internal\\",e=>new rd(e_(e.getProvider(\\"auth\\").getImmediate())),\\"PRIVATE\\").setInstantiationMode(\\"EXPLICIT\\")),(0,n.KO)(rh,rc,function(e){switch(e){case\\"Node\\":return\\"node\\";case\\"ReactNative\\":return\\"rn\\";case\\"Worker\\":return\\"webworker\\";case\\"Cordova\\":return\\"cordova\\";case\\"WebExtension\\":return\\"web-extension\\";default:return}}(i)),(0,n.KO)(rh,rc,\\"esm2020\\")},5648:(e,t,r)=>{\\"use strict\\";r.r(t),r.d(t,{default:()=>I});var i=r(7876);r(7211);var n=r(4232),s=r(7149),a=r(8444),o=r(388),l=r(89),u=class extends l.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let i=t.queryKey,n=t.queryHash??(0,s.F$)(i,t),o=this.get(n);return o||(o=new a.X({client:e,queryKey:i,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:\\"added\\",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:\\"removed\\",query:e}))}clear(){o.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,s.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,s.MK)(e,t)):t}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=r(6305),c=r(8149),d=class extends h.k{#t;#r;#i;#n;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#i=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:\\"idle\\",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#i.notify({type:\\"observerAdded\\",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#i.notify({type:\\"observerRemoved\\",mutation:this,observer:e})}optionalRemove(){this.#r.length||(\\"pending\\"===this.state.status?this.scheduleGc():this.#i.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#s({type:\\"continue\\"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,c.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error(\\"No mutationFn found\\")),onFail:(e,t)=>{this.#s({type:\\"failed\\",failureCount:e,error:t})},onPause:()=>{this.#s({type:\\"pause\\"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});let i=\\"pending\\"===this.state.status,n=!this.#n.canStart();try{if(i)t();else{this.#s({type:\\"pending\\",variables:e,isPaused:n}),await this.#i.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#s({type:\\"pending\\",context:t,variables:e,isPaused:n})}let s=await this.#n.start();return await this.#i.config.onSuccess?.(s,e,this.state.context,this,r),await this.options.onSuccess?.(s,e,this.state.context,r),await this.#i.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,e,this.state.context,r),this.#s({type:\\"success\\",data:s}),s}catch(t){try{throw await this.#i.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#i.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#s({type:\\"error\\",error:t})}}finally{this.#i.runNext(this)}}#s(e){this.state=(t=>{switch(e.type){case\\"failed\\":return{...t,failureCount:e.failureCount,failureReason:e.error};case\\"pause\\":return{...t,isPaused:!0};case\\"continue\\":return{...t,isPaused:!1};case\\"pending\\":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:\\"pending\\",variables:e.variables,submittedAt:Date.now()};case\\"success\\":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:\\"success\\",isPaused:!1};case\\"error\\":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:\\"error\\"}}})(this.state),o.jG.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#i.notify({mutation:this,type:\\"updated\\",action:e})})}},f=class extends l.Q{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#o=new Map,this.#l=0}#a;#o;#l;build(e,t,r){let i=new d({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){this.#a.add(e);let t=p(e);if(\\"string\\"==typeof t){let r=this.#o.get(t);r?r.push(e):this.#o.set(t,[e])}this.notify({type:\\"added\\",mutation:e})}remove(e){if(this.#a.delete(e)){let t=p(e);if(\\"string\\"==typeof t){let r=this.#o.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#o.delete(t)}}this.notify({type:\\"removed\\",mutation:e})}canRun(e){let t=p(e);if(\\"string\\"!=typeof t)return!0;{let r=this.#o.get(t),i=r?.find(e=>\\"pending\\"===e.state.status);return!i||i===e}}runNext(e){let t=p(e);if(\\"string\\"!=typeof t)return Promise.resolve();{let r=this.#o.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){o.jG.batch(()=>{this.#a.forEach(e=>{this.notify({type:\\"removed\\",mutation:e})}),this.#a.clear(),this.#o.clear()})}getAll(){return Array.from(this.#a)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,s.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,s.nJ)(e,t))}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(s.lQ))))}};function p(e){return e.options.scope?.id}var g=r(8275),m=r(8070);function y(e){return{onFetch:(t,r)=>{let i=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},u=0,h=async()=>{let r=!1,h=(0,s.ZM)(t.options,t.fetchOptions),c=async(e,i,n)=>{let a;if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let o=(Object.defineProperty(a={client:t.client,queryKey:t.queryKey,pageParam:i,direction:n?\\"backward\\":\\"forward\\",meta:t.options.meta},\\"signal\\",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener(\\"abort\\",()=>{r=!0}),t.signal)}),a),l=await h(o),{maxPages:u}=t.options,c=n?s.ZZ:s.y9;return{pages:c(e.pages,l,u),pageParams:c(e.pageParams,i,u)}};if(n&&a.length){let e=\\"backward\\"===n,t={pages:a,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:v)(i,t);l=await c(t,r,e)}else{let t=e??a.length;do{let e=0===u?o[0]??i.initialPageParam:v(i,l);if(u>0&&null==e)break;l=await c(l,e),u++}while(ut.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=h}}}function v(e,{pages:t,pageParams:r}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}var w=class{#u;#i;#h;#c;#d;#f;#p;#g;constructor(e={}){this.#u=e.queryCache||new u,this.#i=e.mutationCache||new f,this.#h=e.defaultOptions||{},this.#c=new Map,this.#d=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=g.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#g=m.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#g?.(),this.#g=void 0)}isFetching(e){return this.#u.findAll({...e,fetchStatus:\\"fetching\\"}).length}isMutating(e){return this.#i.findAll({...e,status:\\"pending\\"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#u.build(this,t),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,s.d2)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let i=this.defaultQueryOptions({queryKey:e}),n=this.#u.get(i.queryHash),a=n?.state.data,o=(0,s.Zw)(t,a);if(void 0!==o)return this.#u.build(this,i).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return o.jG.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;o.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#u;return o.jG.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:\\"active\\",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(o.jG.batch(()=>this.#u.findAll(e).map(e=>e.cancel(r)))).then(s.lQ).catch(s.lQ)}invalidateQueries(e,t={}){return o.jG.batch(()=>(this.#u.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===\\"none\\")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??\\"active\\"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.jG.batch(()=>this.#u.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(s.lQ)),\\"paused\\"===e.state.fetchStatus?Promise.resolve():t}))).then(s.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#u.build(this,t);return r.isStaleByTime((0,s.d2)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(s.lQ).catch(s.lQ)}fetchInfiniteQuery(e){return e.behavior=y(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(s.lQ).catch(s.lQ)}ensureInfiniteQueryData(e){return e.behavior=y(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return m.t.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#i}getDefaultOptions(){return this.#h}setDefaultOptions(e){this.#h=e}setQueryDefaults(e,t){this.#c.set((0,s.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#c.values()],r={};return t.forEach(t=>{(0,s.Cp)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#d.set((0,s.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,s.Cp)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#h.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,s.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect=\\"always\\"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=\\"offlineFirst\\"),t.queryFn===s.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#h.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#i.clear()}},b=r(7768),_=r(6647),E=r(7685);function I({Component:e,pageProps:t}){let[r]=(0,n.useState)(()=>new w);return(0,i.jsx)(b.Ht,{client:r,children:(0,i.jsxs)(_.l,{children:[(0,i.jsx)(e,{...t}),(0,i.jsx)(E.l$,{position:\\"top-right\\"})]})})}},6305:(e,t,r)=>{\\"use strict\\";r.d(t,{k:()=>s});var i=r(8306),n=r(7149),s=class{#m;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.gn)(this.gcTime)&&(this.#m=i.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.S$?1/0:3e5))}clearGcTimeout(){this.#m&&(i.zs.clearTimeout(this.#m),this.#m=void 0)}}},6647:(e,t,r)=>{\\"use strict\\";r.d(t,{l:()=>l,t:()=>u});var i=r(7876),n=r(4232),s=r(5176),a=r(7932);let o=(0,n.createContext)(void 0);function l({children:e}){let[t,r]=(0,n.useState)([]),[l,u]=(0,n.useState)(\\"\\"),[h,c]=(0,n.useState)(!0);async function d(){try{let e=await (0,a.Jo)({action:\\"GET_ALL_CLIENTS\\",payload:{}});r(e.data.data||[])}catch(e){console.error(e)}finally{c(!1)}}(0,n.useEffect)(()=>{let e=(0,s.hg)(a.j2,async e=>{e?await d():(r([]),u(\\"\\"),c(!1))});return()=>e()},[]);let f=t.find(e=>e.id===l);return(0,i.jsx)(o.Provider,{value:{clients:t,selectedClientId:l,selectedClient:f,setClient:e=>u(e),loading:h},children:e})}let u=()=>(0,n.useContext)(o)},6653:(e,t,r)=>{\\"use strict\\";r.d(t,{cY:()=>y,FA:()=>M,g:()=>L,u:()=>h,Uj:()=>u,Fy:()=>b,tD:()=>$,bD:()=>function e(t,r){if(t===r)return!0;let i=Object.keys(t),n=Object.keys(r);for(let s of i){if(!n.includes(s))return!1;let i=t[s],a=r[s];if(V(i)&&V(a)){if(!e(i,a))return!1}else if(i!==a)return!1}for(let e of n)if(!i.includes(e))return!1;return!0},hp:()=>B,T9:()=>g,Tj:()=>f,yU:()=>p,XA:()=>m,mS:()=>c,Ku:()=>K,ZQ:()=>T,sr:()=>k,zJ:()=>v,c1:()=>A,Im:()=>F,lT:()=>N,zW:()=>D,jZ:()=>S,lV:()=>R,nr:()=>O,Ov:()=>P,gE:()=>w,Am:()=>j,I9:()=>q,P1:()=>I,eX:()=>x});var i=r(5364);let n=function(e){let t=[],r=0;for(let i=0;i>6|192:((64512&n)==55296&&i+1>18|240,t[r++]=n>>12&63|128):t[r++]=n>>12|224,t[r++]=n>>6&63|128),t[r++]=63&n|128)}return t},s=function(e){let t=[],r=0,i=0;for(;r191&&n<224){let s=e[r++];t[i++]=String.fromCharCode((31&n)<<6|63&s)}else if(n>239&&n<365){let s=((7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[i++]=String.fromCharCode(55296+(s>>10)),t[i++]=String.fromCharCode(56320+(1023&s))}else{let s=e[r++],a=e[r++];t[i++]=String.fromCharCode((15&n)<<12|(63&s)<<6|63&a)}}return t.join(\\"\\")},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+\\"+/=\\"},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+\\"-_.\\"},HAS_NATIVE_SUPPORT:\\"function\\"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error(\\"encodeByteArray takes an array as a parameter\\");this.init_();let r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let t=0;t>2,h=(3&n)<<4|a>>4,c=(15&a)<<2|l>>6,d=63&l;!o&&(d=64,s||(c=64)),i.push(r[u],r[h],r[c],r[d])}return i.join(\\"\\")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(n(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):s(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let r=t?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let t=0;t>4;if(i.push(u),64!==a){let e=s<<4&240|a>>2;if(i.push(e),64!==l){let e=a<<6&192|l;i.push(e)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class o extends Error{constructor(){super(...arguments),this.name=\\"DecodeBase64StringError\\"}}let l=function(e){let t=n(e);return a.encodeByteArray(t,!0)},u=function(e){return l(e).replace(/\\\\./g,\\"\\")},h=function(e){try{return a.decodeString(e,!0)}catch(e){console.error(\\"base64Decode failed: \\",e)}return null};function c(){if(\\"undefined\\"!=typeof self)return self;if(\\"undefined\\"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error(\\"Unable to locate global object.\\")}let d=()=>{try{return c().__FIREBASE_DEFAULTS__||(()=>{if(void 0===i||void 0===i.env)return;let e=i.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)})()||(()=>{let e;if(\\"undefined\\"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&h(e[1]);return t&&JSON.parse(t)})()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},f=e=>d()?.emulatorHosts?.[e],p=e=>{let t=f(e);if(!t)return;let r=t.lastIndexOf(\\":\\");if(r<=0||r+1===t.length)throw Error(`Invalid host ${t} with no separate hostname and port!`);let i=parseInt(t.substring(r+1),10);return\\"[\\"===t[0]?[t.substring(1,r-1),i]:[t.substring(0,r),i]},g=()=>d()?.config,m=e=>d()?.[`_${e}`];class y{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),\\"function\\"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}function v(e){try{return(e.startsWith(\\"http://\\")||e.startsWith(\\"https://\\")?new URL(e).hostname:e).endsWith(\\".cloudworkstations.dev\\")}catch{return!1}}async function w(e){return(await fetch(e,{credentials:\\"include\\"})).ok}function b(e,t){if(e.uid)throw Error(\'The \\"uid\\" field is no longer supported by mockUserToken. Please use \\"sub\\" instead for Firebase Auth User ID.\');let r=t||\\"demo-project\\",i=e.iat||0,n=e.sub||e.user_id;if(!n)throw Error(\\"mockUserToken must contain \'sub\' or \'user_id\' field!\\");let s={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:n,user_id:n,firebase:{sign_in_provider:\\"custom\\",identities:{}},...e};return[u(JSON.stringify({alg:\\"none\\",type:\\"JWT\\"})),u(JSON.stringify(s)),\\"\\"].join(\\".\\")}let _={},E=!1;function I(e,t){if(\\"undefined\\"==typeof window||\\"undefined\\"==typeof document||!v(window.location.host)||_[e]===t||_[e]||E)return;function r(e){return`__firebase__banner__${e}`}_[e]=t;let i=\\"__firebase__banner\\",n=function(){let e={prod:[],emulator:[]};for(let t of Object.keys(_))_[t]?e.emulator.push(t):e.prod.push(t);return e}().prod.length>0;function s(){let e,t,s=(e=document.getElementById(i),t=!1,e||((e=document.createElement(\\"div\\")).setAttribute(\\"id\\",i),t=!0),{created:t,element:e}),a=r(\\"text\\"),o=document.getElementById(a)||document.createElement(\\"span\\"),l=r(\\"learnmore\\"),u=document.getElementById(l)||document.createElement(\\"a\\"),h=r(\\"preprendIcon\\"),c=document.getElementById(h)||document.createElementNS(\\"http://www.w3.org/2000/svg\\",\\"svg\\");if(s.created){let e,t=s.element;t.style.display=\\"flex\\",t.style.background=\\"#7faaf0\\",t.style.position=\\"fixed\\",t.style.bottom=\\"5px\\",t.style.left=\\"5px\\",t.style.padding=\\".5em\\",t.style.borderRadius=\\"5px\\",t.style.alignItems=\\"center\\",u.setAttribute(\\"id\\",l),u.innerText=\\"Learn more\\",u.href=\\"https://firebase.google.com/docs/studio/preview-apps#preview-backend\\",u.setAttribute(\\"target\\",\\"__blank\\"),u.style.paddingLeft=\\"5px\\",u.style.textDecoration=\\"underline\\";let r=((e=document.createElement(\\"span\\")).style.cursor=\\"pointer\\",e.style.marginLeft=\\"16px\\",e.style.fontSize=\\"24px\\",e.innerHTML=\\" ×\\",e.onclick=()=>{let e;E=!0,(e=document.getElementById(i))&&e.remove()},e);c.setAttribute(\\"width\\",\\"24\\"),c.setAttribute(\\"id\\",h),c.setAttribute(\\"height\\",\\"24\\"),c.setAttribute(\\"viewBox\\",\\"0 0 24 24\\"),c.setAttribute(\\"fill\\",\\"none\\"),c.style.marginLeft=\\"-6px\\",t.append(c,o,u,r),document.body.appendChild(t)}n?(o.innerText=\\"Preview backend disconnected.\\",c.innerHTML=`\\n\\n\\n\\n\\n\\n\\n`):(c.innerHTML=`\\n\\n\\n\\n\\n\\n\\n`,o.innerText=\\"Preview backend running in this workspace.\\"),o.setAttribute(\\"id\\",a)}\\"loading\\"===document.readyState?window.addEventListener(\\"DOMContentLoaded\\",s):s()}function T(){return\\"undefined\\"!=typeof navigator&&\\"string\\"==typeof navigator.userAgent?navigator.userAgent:\\"\\"}function S(){return\\"undefined\\"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(T())}function C(){let e=d()?.forceEnvironment;if(\\"node\\"===e)return!0;if(\\"browser\\"===e)return!1;try{return\\"[object process]\\"===Object.prototype.toString.call(r.g.process)}catch(e){return!1}}function A(){return\\"undefined\\"!=typeof navigator&&\\"Cloudflare-Workers\\"===navigator.userAgent}function k(){let e=\\"object\\"==typeof chrome?chrome.runtime:\\"object\\"==typeof browser?browser.runtime:void 0;return\\"object\\"==typeof e&&void 0!==e.id}function R(){return\\"object\\"==typeof navigator&&\\"ReactNative\\"===navigator.product}function N(){let e=T();return e.indexOf(\\"MSIE \\")>=0||e.indexOf(\\"Trident/\\")>=0}function O(){return!C()&&!!navigator.userAgent&&navigator.userAgent.includes(\\"Safari\\")&&!navigator.userAgent.includes(\\"Chrome\\")}function P(){return!C()&&!!navigator.userAgent&&(navigator.userAgent.includes(\\"Safari\\")||navigator.userAgent.includes(\\"WebKit\\"))&&!navigator.userAgent.includes(\\"Chrome\\")}function D(){try{return\\"object\\"==typeof indexedDB}catch(e){return!1}}function x(){return new Promise((e,t)=>{try{let r=!0,i=\\"validate-browser-context-for-indexeddb-analytics-module\\",n=self.indexedDB.open(i);n.onsuccess=()=>{n.result.close(),r||self.indexedDB.deleteDatabase(i),e(!0)},n.onupgradeneeded=()=>{r=!1},n.onerror=()=>{t(n.error?.message||\\"\\")}}catch(e){t(e)}})}class L extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=\\"FirebaseError\\",Object.setPrototypeOf(this,L.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,M.prototype.create)}}class M{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var r,i;let n=t[0]||{},s=`${this.service}/${e}`,a=this.errors[e],o=a?(r=a,i=n,r.replace(U,(e,t)=>{let r=i[t];return null!=r?String(r):`<${t}?>`})):\\"Error\\",l=`${this.serviceName}: ${o} (${s}).`;return new L(s,l,n)}}let U=/\\\\{\\\\$([^}]+)}/g;function F(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function V(e){return null!==e&&\\"object\\"==typeof e}function j(e){let t=[];for(let[r,i]of Object.entries(e))Array.isArray(i)?i.forEach(e=>{t.push(encodeURIComponent(r)+\\"=\\"+encodeURIComponent(e))}):t.push(encodeURIComponent(r)+\\"=\\"+encodeURIComponent(i));return t.length?\\"&\\"+t.join(\\"&\\"):\\"\\"}function q(e){let t={};return e.replace(/^\\\\?/,\\"\\").split(\\"&\\").forEach(e=>{if(e){let[r,i]=e.split(\\"=\\");t[decodeURIComponent(r)]=decodeURIComponent(i)}}),t}function B(e){let t=e.indexOf(\\"?\\");if(!t)return\\"\\";let r=e.indexOf(\\"#\\",t);return e.substring(t,r>0?r:void 0)}function $(e,t){let r=new z(e,t);return r.subscribe.bind(r)}class z{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(void 0===e&&void 0===t&&void 0===r)throw Error(\\"Missing Observer.\\");void 0===(i=!function(e,t){if(\\"object\\"!=typeof e||null===e)return!1;for(let r of t)if(r in e&&\\"function\\"==typeof e[r])return!0;return!1}(e,[\\"next\\",\\"error\\",\\"complete\\"])?{next:e,error:t,complete:r}:e).next&&(i.next=H),void 0===i.error&&(i.error=H),void 0===i.complete&&(i.complete=H);let n=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}}),this.observers.push(i),n}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){\\"undefined\\"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function H(){}function K(e){return e&&e._delegate?e._delegate:e}},6672:(e,t,r)=>{\\"use strict\\";let i,n,s;r.d(t,{MF:()=>M,j6:()=>P,xZ:()=>D,om:()=>O,Sx:()=>F,Wp:()=>U,KO:()=>V});var a=r(1610),o=r(9979),l=r(6653);let u=new WeakMap,h=new WeakMap,c=new WeakMap,d=new WeakMap,f=new WeakMap,p={get(e,t,r){if(e instanceof IDBTransaction){if(\\"done\\"===t)return h.get(e);if(\\"objectStoreNames\\"===t)return e.objectStoreNames||c.get(e);if(\\"store\\"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return g(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&(\\"done\\"===t||\\"store\\"===t)||t in e};function g(e){if(e instanceof IDBRequest){let t;return(t=new Promise((t,r)=>{let i=()=>{e.removeEventListener(\\"success\\",n),e.removeEventListener(\\"error\\",s)},n=()=>{t(g(e.result)),i()},s=()=>{r(e.error),i()};e.addEventListener(\\"success\\",n),e.addEventListener(\\"error\\",s)})).then(t=>{t instanceof IDBCursor&&u.set(t,e)}).catch(()=>{}),f.set(t,e),t}if(d.has(e))return d.get(e);let t=function(e){if(\\"function\\"==typeof e)return e!==IDBDatabase.prototype.transaction||\\"objectStoreNames\\"in IDBTransaction.prototype?(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(m(this),t),g(u.get(this))}:function(...t){return g(e.apply(m(this),t))}:function(t,...r){let i=e.call(m(this),t,...r);return c.set(i,t.sort?t.sort():[t]),g(i)};return e instanceof IDBTransaction&&function(e){if(h.has(e))return;let t=new Promise((t,r)=>{let i=()=>{e.removeEventListener(\\"complete\\",n),e.removeEventListener(\\"error\\",s),e.removeEventListener(\\"abort\\",s)},n=()=>{t(),i()},s=()=>{r(e.error||new DOMException(\\"AbortError\\",\\"AbortError\\")),i()};e.addEventListener(\\"complete\\",n),e.addEventListener(\\"error\\",s),e.addEventListener(\\"abort\\",s)});h.set(e,t)}(e),(i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(e,p):e}(e);return t!==e&&(d.set(e,t),f.set(t,e)),t}let m=e=>f.get(e),y=[\\"get\\",\\"getKey\\",\\"getAll\\",\\"getAllKeys\\",\\"count\\"],v=[\\"put\\",\\"add\\",\\"delete\\",\\"clear\\"],w=new Map;function b(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&\\"string\\"==typeof t))return;if(w.get(t))return w.get(t);let r=t.replace(/FromIndex$/,\\"\\"),i=t!==r,n=v.includes(r);if(!(r in(i?IDBIndex:IDBObjectStore).prototype)||!(n||y.includes(r)))return;let s=async function(e,...t){let s=this.transaction(e,n?\\"readwrite\\":\\"readonly\\"),a=s.store;return i&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),n&&s.done]))[0]};return w.set(t,s),s}p={...s=p,get:(e,t,r)=>b(e,t)||s.get(e,t,r),has:(e,t)=>!!b(e,t)||s.has(e,t)};class _{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{let t;if(t=e.getComponent(),t?.type!==\\"VERSION\\")return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(\\" \\")}}let E=\\"@firebase/app\\",I=\\"0.14.6\\",T=new o.Vy(\\"@firebase/app\\"),S=\\"[DEFAULT]\\",C={[E]:\\"fire-core\\",\\"@firebase/app-compat\\":\\"fire-core-compat\\",\\"@firebase/analytics\\":\\"fire-analytics\\",\\"@firebase/analytics-compat\\":\\"fire-analytics-compat\\",\\"@firebase/app-check\\":\\"fire-app-check\\",\\"@firebase/app-check-compat\\":\\"fire-app-check-compat\\",\\"@firebase/auth\\":\\"fire-auth\\",\\"@firebase/auth-compat\\":\\"fire-auth-compat\\",\\"@firebase/database\\":\\"fire-rtdb\\",\\"@firebase/data-connect\\":\\"fire-data-connect\\",\\"@firebase/database-compat\\":\\"fire-rtdb-compat\\",\\"@firebase/functions\\":\\"fire-fn\\",\\"@firebase/functions-compat\\":\\"fire-fn-compat\\",\\"@firebase/installations\\":\\"fire-iid\\",\\"@firebase/installations-compat\\":\\"fire-iid-compat\\",\\"@firebase/messaging\\":\\"fire-fcm\\",\\"@firebase/messaging-compat\\":\\"fire-fcm-compat\\",\\"@firebase/performance\\":\\"fire-perf\\",\\"@firebase/performance-compat\\":\\"fire-perf-compat\\",\\"@firebase/remote-config\\":\\"fire-rc\\",\\"@firebase/remote-config-compat\\":\\"fire-rc-compat\\",\\"@firebase/storage\\":\\"fire-gcs\\",\\"@firebase/storage-compat\\":\\"fire-gcs-compat\\",\\"@firebase/firestore\\":\\"fire-fst\\",\\"@firebase/firestore-compat\\":\\"fire-fst-compat\\",\\"@firebase/ai\\":\\"fire-vertex\\",\\"fire-js\\":\\"fire-js\\",firebase:\\"fire-js-all\\"},A=new Map,k=new Map,R=new Map;function N(e,t){try{e.container.addComponent(t)}catch(r){T.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function O(e){let t=e.name;if(R.has(t))return T.debug(`There were multiple attempts to register component ${t}.`),!1;for(let r of(R.set(t,e),A.values()))N(r,e);for(let t of k.values())N(t,e);return!0}function P(e,t){let r=e.container.getProvider(\\"heartbeat\\").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function D(e){return null!=e&&void 0!==e.settings}let x=new l.FA(\\"app\\",\\"Firebase\\",{\\"no-app\\":\\"No Firebase App \'{$appName}\' has been created - call initializeApp() first\\",\\"bad-app-name\\":\\"Illegal App name: \'{$appName}\'\\",\\"duplicate-app\\":\\"Firebase App named \'{$appName}\' already exists with different options or config\\",\\"app-deleted\\":\\"Firebase App named \'{$appName}\' already deleted\\",\\"server-app-deleted\\":\\"Firebase Server App has been deleted\\",\\"no-options\\":\\"Need to provide options, when not being deployed to hosting via source.\\",\\"invalid-app-argument\\":\\"firebase.{$appName}() takes either no argument or a Firebase App instance.\\",\\"invalid-log-argument\\":\\"First argument to `onLog` must be null or a function.\\",\\"idb-open\\":\\"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.\\",\\"idb-get\\":\\"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.\\",\\"idb-set\\":\\"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.\\",\\"idb-delete\\":\\"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.\\",\\"finalization-registry-not-supported\\":\\"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.\\",\\"invalid-server-app-environment\\":\\"FirebaseServerApp is not for use in browser environments.\\"});class L{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new a.uA(\\"app\\",()=>this,\\"PUBLIC\\"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw x.create(\\"app-deleted\\",{appName:this._name})}}let M=\\"12.6.0\\";function U(e,t={}){let r=e;\\"object\\"!=typeof t&&(t={name:t});let i={name:S,automaticDataCollectionEnabled:!0,...t},n=i.name;if(\\"string\\"!=typeof n||!n)throw x.create(\\"bad-app-name\\",{appName:String(n)});if(r||(r=(0,l.T9)()),!r)throw x.create(\\"no-options\\");let s=A.get(n);if(s)if((0,l.bD)(r,s.options)&&(0,l.bD)(i,s.config))return s;else throw x.create(\\"duplicate-app\\",{appName:n});let o=new a.h1(n);for(let e of R.values())o.addComponent(e);let u=new L(r,i,o);return A.set(n,u),u}function F(e=S){let t=A.get(e);if(!t&&e===S&&(0,l.T9)())return U();if(!t)throw x.create(\\"no-app\\",{appName:e});return t}function V(e,t,r){let i=C[e]??e;r&&(i+=`-${r}`);let n=i.match(/\\\\s|\\\\//),s=t.match(/\\\\s|\\\\//);if(n||s){let e=[`Unable to register library \\"${i}\\" with version \\"${t}\\":`];n&&e.push(`library name \\"${i}\\" contains illegal characters (whitespace or \\"/\\")`),n&&s&&e.push(\\"and\\"),s&&e.push(`version name \\"${t}\\" contains illegal characters (whitespace or \\"/\\")`),T.warn(e.join(\\" \\"));return}O(new a.uA(`${i}-version`,()=>({library:i,version:t}),\\"VERSION\\"))}let j=\\"firebase-heartbeat-store\\",q=null;function B(){return q||(q=(function(e,t,{blocked:r,upgrade:i,blocking:n,terminated:s}={}){let a=indexedDB.open(e,1),o=g(a);return i&&a.addEventListener(\\"upgradeneeded\\",e=>{i(g(a.result),e.oldVersion,e.newVersion,g(a.transaction),e)}),r&&a.addEventListener(\\"blocked\\",e=>r(e.oldVersion,e.newVersion,e)),o.then(e=>{s&&e.addEventListener(\\"close\\",()=>s()),n&&e.addEventListener(\\"versionchange\\",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o})(\\"firebase-heartbeat-database\\",0,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(j)}catch(e){console.warn(e)}}}).catch(e=>{throw x.create(\\"idb-open\\",{originalErrorMessage:e.message})})),q}async function $(e){try{let t=(await B()).transaction(j),r=await t.objectStore(j).get(H(e));return await t.done,r}catch(e){if(e instanceof l.g)T.warn(e.message);else{let t=x.create(\\"idb-get\\",{originalErrorMessage:e?.message});T.warn(t.message)}}}async function z(e,t){try{let r=(await B()).transaction(j,\\"readwrite\\"),i=r.objectStore(j);await i.put(t,H(e)),await r.done}catch(e){if(e instanceof l.g)T.warn(e.message);else{let t=x.create(\\"idb-set\\",{originalErrorMessage:e?.message});T.warn(t.message)}}}function H(e){return`${e.name}!${e.options.appId}`}class K{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider(\\"app\\").getImmediate();this._storage=new Q(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{let e=this.container.getProvider(\\"platform-logger\\").getImmediate().getPlatformInfoString(),t=G();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){let e=function(e){if(0===e.length)return -1;let t=0,r=e[0].date;for(let i=1;ie.agent===n.agent);if(e){if(e.dates.push(n.date),W(r)>t){e.dates.pop();break}}else if(r.push({agent:n.agent,dates:[n.date]}),W(r)>t){r.pop();break}i=i.slice(1)}return{heartbeatsToSend:r,unsentEntries:i}}(this._heartbeatsCache.heartbeats),i=(0,l.Uj)(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return T.warn(e),\\"\\"}}}function G(){return new Date().toISOString().substring(0,10)}class Q{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,l.zW)()&&(0,l.eX)().then(()=>!0).catch(()=>!1)}async read(){if(!await this._canUseIndexedDBPromise)return{heartbeats:[]};{let e=await $(this.app);return e?.heartbeats?e:{heartbeats:[]}}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return z(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return z(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function W(e){return(0,l.Uj)(JSON.stringify({version:2,heartbeats:e})).length}O(new a.uA(\\"platform-logger\\",e=>new _(e),\\"PRIVATE\\")),O(new a.uA(\\"heartbeat\\",e=>new K(e),\\"PRIVATE\\")),V(E,I,\\"\\"),V(E,I,\\"esm2020\\"),V(\\"fire-js\\",\\"\\")},7149:(e,t,r)=>{\\"use strict\\";r.d(t,{Cp:()=>g,EN:()=>p,Eh:()=>h,F$:()=>f,GU:()=>A,MK:()=>c,S$:()=>n,ZM:()=>C,ZZ:()=>T,Zw:()=>a,d2:()=>u,f8:()=>y,gn:()=>o,hT:()=>S,j3:()=>l,lQ:()=>s,nJ:()=>d,pl:()=>E,y9:()=>I,yy:()=>_});var i=r(8306),n=\\"undefined\\"==typeof window||\\"Deno\\"in globalThis;function s(){}function a(e,t){return\\"function\\"==typeof e?e(t):e}function o(e){return\\"number\\"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return\\"function\\"==typeof e?e(t):e}function h(e,t){return\\"function\\"==typeof e?e(t):e}function c(e,t){let{type:r=\\"all\\",exact:i,fetchStatus:n,predicate:s,queryKey:a,stale:o}=e;if(a){if(i){if(t.queryHash!==f(a,t.options))return!1}else if(!g(t.queryKey,a))return!1}if(\\"all\\"!==r){let e=t.isActive();if(\\"active\\"===r&&!e||\\"inactive\\"===r&&e)return!1}return(\\"boolean\\"!=typeof o||t.isStale()===o)&&(!n||n===t.state.fetchStatus)&&(!s||!!s(t))}function d(e,t){let{exact:r,status:i,predicate:n,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(s))return!1}else if(!g(t.options.mutationKey,s))return!1}return(!i||t.state.status===i)&&(!n||!!n(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&\\"object\\"==typeof e&&\\"object\\"==typeof t&&Object.keys(t).every(r=>g(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function y(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!b(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!b(r)&&!!r.hasOwnProperty(\\"isPrototypeOf\\")&&Object.getPrototypeOf(e)===Object.prototype}function b(e){return\\"[object Object]\\"===Object.prototype.toString.call(e)}function _(e){return new Promise(t=>{i.zs.setTimeout(t,e)})}function E(e,t,r){return\\"function\\"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let i=v(t)&&v(r);if(!i&&!(w(t)&&w(r)))return r;let n=(i?t:Object.keys(t)).length,s=i?r:Object.keys(r),a=s.length,o=i?Array(a):{},l=0;for(let u=0;ur?i.slice(1):i}function T(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var S=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==S?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: \'${e.queryHash}\'`))}function A(e,t){return\\"function\\"==typeof e?e(...t):!!e}},7211:()=>{},7685:(e,t,r)=>{\\"use strict\\";let i,n;r.d(t,{l$:()=>ee,Ay:()=>et});var s,a=r(4232);let o={data:\\"\\"},l=/(?:([\\\\u0080-\\\\uFFFF\\\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\\\s*)/g,u=/\\\\/\\\\*[^]*?\\\\*\\\\/| +/g,h=/\\\\n+/g,c=(e,t)=>{let r=\\"\\",i=\\"\\",n=\\"\\";for(let s in e){let a=e[s];\\"@\\"==s[0]?\\"i\\"==s[1]?r=s+\\" \\"+a+\\";\\":i+=\\"f\\"==s[1]?c(a,s):s+\\"{\\"+c(a,\\"k\\"==s[1]?\\"\\":t)+\\"}\\":\\"object\\"==typeof a?i+=c(a,t?t.replace(/([^,])+/g,e=>s.replace(/([^,]*:\\\\S+\\\\([^)]*\\\\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+\\" \\"+t:t)):s):null!=a&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,\\"-$&\\").toLowerCase(),n+=c.p?c.p(s,a):s+\\":\\"+a+\\";\\")}return r+(t&&n?t+\\"{\\"+n+\\"}\\":n)+i},d={},f=e=>{if(\\"object\\"==typeof e){let t=\\"\\";for(let r in e)t+=r+f(e[r]);return t}return e};function p(e){let t,r,i=this||{},n=e.call?e(i.p):e;return((e,t,r,i,n)=>{var s;let a=f(e),o=d[a]||(d[a]=(e=>{let t=0,r=11;for(;t>>0;return\\"go\\"+r})(a));if(!d[o]){let t=a!==e?e:(e=>{let t,r,i=[{}];for(;t=l.exec(e.replace(u,\\"\\"));)t[4]?i.shift():t[3]?(r=t[3].replace(h,\\" \\").trim(),i.unshift(i[0][r]=i[0][r]||{})):i[0][t[1]]=t[2].replace(h,\\" \\").trim();return i[0]})(e);d[o]=c(n?{[\\"@keyframes \\"+o]:t}:t,r?\\"\\":\\".\\"+o)}let p=r&&d.g?d.g:null;return r&&(d.g=d[o]),s=d[o],p?t.data=t.data.replace(p,s):-1===t.data.indexOf(s)&&(t.data=i?s+t.data:t.data+s),o})(n.unshift?n.raw?(t=[].slice.call(arguments,1),r=i.p,n.reduce((e,i,n)=>{let s=t[n];if(s&&s.call){let e=s(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;s=t?\\".\\"+t:e&&\\"object\\"==typeof e?e.props?\\"\\":c(e,\\"\\"):!1===e?\\"\\":e}return e+i+(null==s?\\"\\":s)},\\"\\")):n.reduce((e,t)=>Object.assign(e,t&&t.call?t(i.p):t),{}):n,(e=>{if(\\"object\\"==typeof window){let t=(e?e.querySelector(\\"#_goober\\"):window._goober)||Object.assign(document.createElement(\\"style\\"),{innerHTML:\\" \\",id:\\"_goober\\"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||o})(i.target),i.g,i.o,i.k)}p.bind({g:1});let g,m,y,v=p.bind({k:1});function w(e,t){let r=this||{};return function(){let i=arguments;function n(s,a){let o=Object.assign({},s),l=o.className||n.className;r.p=Object.assign({theme:m&&m()},o),r.o=/ *go\\\\d+/.test(l),o.className=p.apply(r,i)+(l?\\" \\"+l:\\"\\"),t&&(o.ref=a);let u=e;return e[0]&&(u=o.as||e,delete o.as),y&&u[0]&&y(o),g(u,o)}return t?t(n):n}}var b=(e,t)=>\\"function\\"==typeof e?e(t):e,_=(i=0,()=>(++i).toString()),E=()=>{if(void 0===n&&\\"u\\">typeof window){let e=matchMedia(\\"(prefers-reduced-motion: reduce)\\");n=!e||e.matches}return n},I=\\"default\\",T=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:i}=t;return T(e,{type:+!!e.toasts.find(e=>e.id===i.id),toast:i});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(e=>e.id===n||void 0===n?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+s}))}}},S=[],C={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},A={},k=(e,t=I)=>{A[t]=T(A[t]||C,e),S.forEach(([e,r])=>{e===t&&r(A[t])})},R=e=>Object.keys(A).forEach(t=>k(e,t)),N=(e=I)=>t=>{k(t,e)},O={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},P=e=>(t,r)=>{let i,n=((e,t=\\"blank\\",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:\\"status\\",\\"aria-live\\":\\"polite\\"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||_()}))(t,e,r);return N(n.toasterId||(i=n.id,Object.keys(A).find(e=>A[e].toasts.some(e=>e.id===i))))({type:2,toast:n}),n.id},D=(e,t)=>P(\\"blank\\")(e,t);D.error=P(\\"error\\"),D.success=P(\\"success\\"),D.loading=P(\\"loading\\"),D.custom=P(\\"custom\\"),D.dismiss=(e,t)=>{let r={type:3,toastId:e};t?N(t)(r):R(r)},D.dismissAll=e=>D.dismiss(void 0,e),D.remove=(e,t)=>{let r={type:4,toastId:e};t?N(t)(r):R(r)},D.removeAll=e=>D.remove(void 0,e),D.promise=(e,t,r)=>{let i=D.loading(t.loading,{...r,...null==r?void 0:r.loading});return\\"function\\"==typeof e&&(e=e()),e.then(e=>{let n=t.success?b(t.success,e):void 0;return n?D.success(n,{id:i,...r,...null==r?void 0:r.success}):D.dismiss(i),e}).catch(e=>{let n=t.error?b(t.error,e):void 0;n?D.error(n,{id:i,...r,...null==r?void 0:r.error}):D.dismiss(i)}),e};var x=1e3,L=v`\\nfrom {\\n transform: scale(0) rotate(45deg);\\n\\topacity: 0;\\n}\\nto {\\n transform: scale(1) rotate(45deg);\\n opacity: 1;\\n}`,M=v`\\nfrom {\\n transform: scale(0);\\n opacity: 0;\\n}\\nto {\\n transform: scale(1);\\n opacity: 1;\\n}`,U=v`\\nfrom {\\n transform: scale(0) rotate(90deg);\\n\\topacity: 0;\\n}\\nto {\\n transform: scale(1) rotate(90deg);\\n\\topacity: 1;\\n}`,F=w(\\"div\\")`\\n width: 20px;\\n opacity: 0;\\n height: 20px;\\n border-radius: 10px;\\n background: ${e=>e.primary||\\"#ff4b4b\\"};\\n position: relative;\\n transform: rotate(45deg);\\n\\n animation: ${L} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\\n forwards;\\n animation-delay: 100ms;\\n\\n &:after,\\n &:before {\\n content: \'\';\\n animation: ${M} 0.15s ease-out forwards;\\n animation-delay: 150ms;\\n position: absolute;\\n border-radius: 3px;\\n opacity: 0;\\n background: ${e=>e.secondary||\\"#fff\\"};\\n bottom: 9px;\\n left: 4px;\\n height: 2px;\\n width: 12px;\\n }\\n\\n &:before {\\n animation: ${U} 0.15s ease-out forwards;\\n animation-delay: 180ms;\\n transform: rotate(90deg);\\n }\\n`,V=v`\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n`,j=w(\\"div\\")`\\n width: 12px;\\n height: 12px;\\n box-sizing: border-box;\\n border: 2px solid;\\n border-radius: 100%;\\n border-color: ${e=>e.secondary||\\"#e0e0e0\\"};\\n border-right-color: ${e=>e.primary||\\"#616161\\"};\\n animation: ${V} 1s linear infinite;\\n`,q=v`\\nfrom {\\n transform: scale(0) rotate(45deg);\\n\\topacity: 0;\\n}\\nto {\\n transform: scale(1) rotate(45deg);\\n\\topacity: 1;\\n}`,B=v`\\n0% {\\n\\theight: 0;\\n\\twidth: 0;\\n\\topacity: 0;\\n}\\n40% {\\n height: 0;\\n\\twidth: 6px;\\n\\topacity: 1;\\n}\\n100% {\\n opacity: 1;\\n height: 10px;\\n}`,$=w(\\"div\\")`\\n width: 20px;\\n opacity: 0;\\n height: 20px;\\n border-radius: 10px;\\n background: ${e=>e.primary||\\"#61d345\\"};\\n position: relative;\\n transform: rotate(45deg);\\n\\n animation: ${q} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\\n forwards;\\n animation-delay: 100ms;\\n &:after {\\n content: \'\';\\n box-sizing: border-box;\\n animation: ${B} 0.2s ease-out forwards;\\n opacity: 0;\\n animation-delay: 200ms;\\n position: absolute;\\n border-right: 2px solid;\\n border-bottom: 2px solid;\\n border-color: ${e=>e.secondary||\\"#fff\\"};\\n bottom: 6px;\\n left: 6px;\\n height: 10px;\\n width: 6px;\\n }\\n`,z=w(\\"div\\")`\\n position: absolute;\\n`,H=w(\\"div\\")`\\n position: relative;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n min-width: 20px;\\n min-height: 20px;\\n`,K=v`\\nfrom {\\n transform: scale(0.6);\\n opacity: 0.4;\\n}\\nto {\\n transform: scale(1);\\n opacity: 1;\\n}`,G=w(\\"div\\")`\\n position: relative;\\n transform: scale(0.6);\\n opacity: 0.4;\\n min-width: 20px;\\n animation: ${K} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)\\n forwards;\\n`,Q=({toast:e})=>{let{icon:t,type:r,iconTheme:i}=e;return void 0!==t?\\"string\\"==typeof t?a.createElement(G,null,t):t:\\"blank\\"===r?null:a.createElement(H,null,a.createElement(j,{...i}),\\"loading\\"!==r&&a.createElement(z,null,\\"error\\"===r?a.createElement(F,{...i}):a.createElement($,{...i})))},W=w(\\"div\\")`\\n display: flex;\\n align-items: center;\\n background: #fff;\\n color: #363636;\\n line-height: 1.3;\\n will-change: transform;\\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);\\n max-width: 350px;\\n pointer-events: auto;\\n padding: 8px 10px;\\n border-radius: 8px;\\n`,J=w(\\"div\\")`\\n display: flex;\\n justify-content: center;\\n margin: 4px 10px;\\n color: inherit;\\n flex: 1 1 auto;\\n white-space: pre-line;\\n`,X=a.memo(({toast:e,position:t,style:r,children:i})=>{let n=e.height?((e,t)=>{let r=e.includes(\\"top\\")?1:-1,[i,n]=E()?[\\"0%{opacity:0;} 100%{opacity:1;}\\",\\"0%{opacity:1;} 100%{opacity:0;}\\"]:[`\\n0% {transform: translate3d(0,${-200*r}%,0) scale(.6); opacity:.5;}\\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\\n`,`\\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\\n100% {transform: translate3d(0,${-150*r}%,-1px) scale(.6); opacity:0;}\\n`];return{animation:t?`${v(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${v(n)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||\\"top-center\\",e.visible):{opacity:0},s=a.createElement(Q,{toast:e}),o=a.createElement(J,{...e.ariaProps},b(e.message,e));return a.createElement(W,{className:e.className,style:{...n,...r,...e.style}},\\"function\\"==typeof i?i({icon:s,message:o}):a.createElement(a.Fragment,null,s,o))});s=a.createElement,c.p=void 0,g=s,m=void 0,y=void 0;var Y=({id:e,className:t,style:r,onHeightUpdate:i,children:n})=>{let s=a.useCallback(t=>{if(t){let r=()=>{i(e,t.getBoundingClientRect().height)};r(),new MutationObserver(r).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,i]);return a.createElement(\\"div\\",{ref:s,className:t,style:r},n)},Z=p`\\n z-index: 9999;\\n > * {\\n pointer-events: auto;\\n }\\n`,ee=({reverseOrder:e,position:t=\\"top-center\\",toastOptions:r,gutter:i,children:n,toasterId:s,containerStyle:o,containerClassName:l})=>{let{toasts:u,handlers:h}=((e,t=\\"default\\")=>{let{toasts:r,pausedAt:i}=((e={},t=I)=>{let[r,i]=(0,a.useState)(A[t]||C),n=(0,a.useRef)(A[t]);(0,a.useEffect)(()=>(n.current!==A[t]&&i(A[t]),S.push([t,i]),()=>{let e=S.findIndex(([e])=>e===t);e>-1&&S.splice(e,1)}),[t]);let s=r.toasts.map(t=>{var r,i,n;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(r=e[t.type])?void 0:r.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(i=e[t.type])?void 0:i.duration)||(null==e?void 0:e.duration)||O[t.type],style:{...e.style,...null==(n=e[t.type])?void 0:n.style,...t.style}}});return{...r,toasts:s}})(e,t),n=(0,a.useRef)(new Map).current,s=(0,a.useCallback)((e,t=x)=>{if(n.has(e))return;let r=setTimeout(()=>{n.delete(e),o({type:4,toastId:e})},t);n.set(e,r)},[]);(0,a.useEffect)(()=>{if(i)return;let e=Date.now(),n=r.map(r=>{if(r.duration===1/0)return;let i=(r.duration||0)+r.pauseDuration-(e-r.createdAt);if(i<0){r.visible&&D.dismiss(r.id);return}return setTimeout(()=>D.dismiss(r.id,t),i)});return()=>{n.forEach(e=>e&&clearTimeout(e))}},[r,i,t]);let o=(0,a.useCallback)(N(t),[t]),l=(0,a.useCallback)(()=>{o({type:5,time:Date.now()})},[o]),u=(0,a.useCallback)((e,t)=>{o({type:1,toast:{id:e,height:t}})},[o]),h=(0,a.useCallback)(()=>{i&&o({type:6,time:Date.now()})},[i,o]),c=(0,a.useCallback)((e,t)=>{let{reverseOrder:i=!1,gutter:n=8,defaultPosition:s}=t||{},a=r.filter(t=>(t.position||s)===(e.position||s)&&t.height),o=a.findIndex(t=>t.id===e.id),l=a.filter((e,t)=>te.visible).slice(...i?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+n,0)},[r]);return(0,a.useEffect)(()=>{r.forEach(e=>{if(e.dismissed)s(e.id,e.removeDelay);else{let t=n.get(e.id);t&&(clearTimeout(t),n.delete(e.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:u,startPause:l,endPause:h,calculateOffset:c}}})(r,s);return a.createElement(\\"div\\",{\\"data-rht-toaster\\":s||\\"\\",style:{position:\\"fixed\\",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:\\"none\\",...o},className:l,onMouseEnter:h.startPause,onMouseLeave:h.endPause},u.map(r=>{let s,o,l=r.position||t,u=h.calculateOffset(r,{reverseOrder:e,gutter:i,defaultPosition:t}),c=(s=l.includes(\\"top\\"),o=l.includes(\\"center\\")?{justifyContent:\\"center\\"}:l.includes(\\"right\\")?{justifyContent:\\"flex-end\\"}:{},{left:0,right:0,display:\\"flex\\",position:\\"absolute\\",transition:E()?void 0:\\"all 230ms cubic-bezier(.21,1.02,.73,1)\\",transform:`translateY(${u*(s?1:-1)}px)`,...s?{top:0}:{bottom:0},...o});return a.createElement(Y,{id:r.id,key:r.id,onHeightUpdate:h.updateHeight,className:r.visible?Z:\\"\\",style:c},\\"custom\\"===r.type?b(r.message,r):n?n(r):a.createElement(X,{toast:r,position:l}))}))},et=D},7768:(e,t,r)=>{\\"use strict\\";r.d(t,{Ht:()=>o,jE:()=>a});var i=r(4232),n=r(7876),s=i.createContext(void 0),a=e=>{let t=i.useContext(s);if(e)return e;if(!t)throw Error(\\"No QueryClient set, use QueryClientProvider to set one\\");return t},o=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,n.jsx)(s.Provider,{value:e,children:t}))},7932:(e,t,r)=>{\\"use strict\\";r.d(t,{j2:()=>l,eg:()=>v,kU:()=>f,r6:()=>p,Jo:()=>d,zR:()=>y,vw:()=>m,$H:()=>c,mm:()=>g,db:()=>h,Cn:()=>u,Zt:()=>_,Ri:()=>b,bY:()=>w});var i=r(6672);(0,i.KO)(\\"firebase\\",\\"12.7.0\\",\\"app\\");var n=r(5176),s=r(2921),a=r(485);let o=(0,i.Wp)({apiKey:\\"AIzaSyBJaTiMekwbGPXAm-mkPl_u6KEWCSpvfic\\",authDomain:\\"comtroldata.firebaseapp.com\\",projectId:\\"comtroldata\\",storageBucket:\\"comtroldata.firebasestorage.app\\",messagingSenderId:\\"698108879063\\",appId:\\"1:698108879063:web:ab30eb8b80a774f52f1092\\",measurementId:\\"G-SWCD6XEWDH\\"}),l=(0,n.xI)(o),u=(0,s.Uz)(o,\\"us-central1\\"),h=(0,a.aU)(o),c=(0,s.Qg)(u,\\"manageSystemUsers\\"),d=(0,s.Qg)(u,\\"manageHierarchy\\"),f=(0,s.Qg)(u,\\"manageData\\"),p=(0,s.Qg)(u,\\"manageEmployees\\"),g=(0,s.Qg)(u,\\"scheduleShift\\"),m=(0,s.Qg)(u,\\"manageShifts\\"),y=(0,s.Qg)(u,\\"managePatterns\\"),v=(0,s.Qg)(u,\\"checkSystemHealth\\");async function w(e){let t=(0,a.H9)(h,\\"objetivos\\",e),r=await (0,a.x7)(t),i=new Date;i.setHours(0,0,0,0);let n=(0,a.P)((0,a.rJ)(h,\\"turnos\\"),(0,a._M)(\\"objectiveId\\",\\"==\\",e),(0,a._M)(\\"startTime\\",\\">=\\",i)),s=await (0,a.GG)(n);return{objective:{id:r.id,...r.data()},shifts:s.docs.map(e=>({id:e.id,...e.data()}))}}async function b(e){let t=(0,a.P)((0,a.rJ)(h,\\"contratos_servicio\\"),(0,a._M)(\\"objectiveId\\",\\"==\\",e));return(await (0,a.GG)(t)).docs.map(e=>({id:e.id,...e.data()}))}async function _(e){let t=(0,a.P)((0,a.rJ)(h,\\"contratos_servicio\\"),(0,a._M)(\\"objectiveId\\",\\"==\\",e),(0,a._M)(\\"isActive\\",\\"==\\",!0)),r=await (0,a.GG)(t);return r.empty?null:{id:r.docs[0].id,...r.docs[0].data()}}},8070:(e,t,r)=>{\\"use strict\\";r.d(t,{t:()=>s});var i=r(89),n=r(7149),s=new class extends i.Q{#y=!0;#v;#w;constructor(){super(),this.#w=e=>{if(!n.S$&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener(\\"online\\",t,!1),window.addEventListener(\\"offline\\",r,!1),()=>{window.removeEventListener(\\"online\\",t),window.removeEventListener(\\"offline\\",r)}}}}onSubscribe(){this.#v||this.setEventListener(this.#w)}onUnsubscribe(){this.hasListeners()||(this.#v?.(),this.#v=void 0)}setEventListener(e){this.#w=e,this.#v?.(),this.#v=e(this.setOnline.bind(this))}setOnline(e){this.#y!==e&&(this.#y=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#y}}},8149:(e,t,r)=>{\\"use strict\\";r.d(t,{II:()=>h,cc:()=>u,v_:()=>l});var i=r(8275),n=r(8070),s=r(1883),a=r(7149);function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??\\"online\\")!==\\"online\\"||n.t.isOnline()}var u=class extends Error{constructor(e){super(\\"CancelledError\\"),this.revert=e?.revert,this.silent=e?.silent}};function h(e){let t,r=!1,h=0,c=(0,s.T)(),d=()=>i.m.isFocused()&&(\\"always\\"===e.networkMode||n.t.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),p=e=>{\\"pending\\"===c.status&&(t?.(),c.resolve(e))},g=e=>{\\"pending\\"===c.status&&(t?.(),c.reject(e))},m=()=>new Promise(r=>{t=e=>{(\\"pending\\"!==c.status||d())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,\\"pending\\"===c.status&&e.onContinue?.()}),y=()=>{let t;if(\\"pending\\"!==c.status)return;let i=0===h?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if(\\"pending\\"!==c.status)return;let i=e.retry??3*!a.S$,n=e.retryDelay??o,s=\\"function\\"==typeof n?n(h,t):n,l=!0===i||\\"number\\"==typeof i&&hd()?void 0:m()).then(()=>{r?g(t):y()}))})};return{promise:c,status:()=>c.status,cancel:t=>{if(\\"pending\\"===c.status){let r=new u(t);g(r),e.onCancel?.(r)}},continue:()=>(t?.(),c),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:f,start:()=>(f()?y():m().then(y),c)}}},8220:e=>{var t={675:function(e,t){\\"use strict\\";t.byteLength=function(e){var t=l(e),r=t[0],i=t[1];return(r+i)*3/4-i},t.toByteArray=function(e){var t,r,s=l(e),a=s[0],o=s[1],u=new n((a+o)*3/4-o),h=0,c=o>0?a-4:a;for(r=0;r>16&255,u[h++]=t>>8&255,u[h++]=255&t;return 2===o&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[h++]=255&t),1===o&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=255&t),u},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],a=0,o=i-n;a>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join(\\"\\")}(e,a,a+16383>o?o:a+16383));return 1===n?s.push(r[(t=e[i-1])>>2]+r[t<<4&63]+\\"==\\"):2===n&&s.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+\\"=\\"),s.join(\\"\\")};for(var r=[],i=[],n=\\"undefined\\"!=typeof Uint8Array?Uint8Array:Array,s=\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\\",a=0,o=s.length;a0)throw Error(\\"Invalid string. Length must be a multiple of 4\\");var r=e.indexOf(\\"=\\");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},72:function(e,t,r){\\"use strict\\";var i=r(675),n=r(783),s=\\"function\\"==typeof Symbol&&\\"function\\"==typeof Symbol.for?Symbol.for(\\"nodejs.util.inspect.custom\\"):null;function a(e){if(e>0x7fffffff)throw RangeError(\'The value \\"\'+e+\'\\" is invalid for option \\"size\\"\');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if(\\"number\\"==typeof e){if(\\"string\\"==typeof t)throw TypeError(\'The \\"string\\" argument must be of type string. Received type number\');return h(e)}return l(e,t,r)}function l(e,t,r){if(\\"string\\"==typeof e){var i=e,n=t;if((\\"string\\"!=typeof n||\\"\\"===n)&&(n=\\"utf8\\"),!o.isEncoding(n))throw TypeError(\\"Unknown encoding: \\"+n);var s=0|f(i,n),l=a(s),u=l.write(i,n);return u!==s&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError(\\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \\"+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer)||\\"undefined\\"!=typeof SharedArrayBuffer&&(R(e,SharedArrayBuffer)||e&&R(e.buffer,SharedArrayBuffer)))return function(e,t,r){var i;if(t<0||e.byteLength=0x7fffffff)throw RangeError(\\"Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes\\");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if(\\"string\\"!=typeof e)throw TypeError(\'The \\"string\\" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case\\"ascii\\":case\\"latin1\\":case\\"binary\\":return r;case\\"utf8\\":case\\"utf-8\\":return S(e).length;case\\"ucs2\\":case\\"ucs-2\\":case\\"utf16le\\":case\\"utf-16le\\":return 2*r;case\\"hex\\":return r>>>1;case\\"base64\\":return A(e).length;default:if(n)return i?-1:S(e).length;t=(\\"\\"+t).toLowerCase(),n=!0}}function p(e,t,r){var n,s,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return\\"\\";for(e||(e=\\"utf8\\");;)switch(e){case\\"hex\\":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var n=\\"\\",s=t;s0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(n)return -1;else r=e.length-1;else if(r<0)if(!n)return -1;else r=0;if(\\"string\\"==typeof t&&(t=o.from(t,i)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,i,n);if(\\"number\\"==typeof t){if(t&=255,\\"function\\"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,i,n)}throw TypeError(\\"val must be string, number or Buffer\\")}function y(e,t,r,i,n){var s,a=1,o=e.length,l=t.length;if(void 0!==i&&(\\"ucs2\\"===(i=String(i).toLowerCase())||\\"ucs-2\\"===i||\\"utf16le\\"===i||\\"utf-16le\\"===i)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(s=r;so&&(r=o-l),s=r;s>=0;s--){for(var c=!0,d=0;dr&&(e+=\\" ... \\"),\\"\\"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(e,t,r,i,n){if(R(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError(\'The \\"target\\" argument must be one of type Buffer or Uint8Array. Received type \'+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw RangeError(\\"out of range index\\");if(i>=n&&t>=r)return 0;if(i>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;for(var s=n-i,a=r-t,l=Math.min(s,a),u=this.slice(i,n),h=e.slice(t,r),c=0;c239?4:u>223?3:u>191?2:1;if(n+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:(192&(s=e[n+1]))==128&&(l=(31&u)<<6|63&s)>127&&(h=l);break;case 3:s=e[n+1],a=e[n+2],(192&s)==128&&(192&a)==128&&(l=(15&u)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=e[n+1],a=e[n+2],o=e[n+3],(192&s)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}var d=i,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var p=\\"\\",g=0;gr)throw RangeError(\\"Trying to access beyond buffer length\\")}function b(e,t,r,i,n,s){if(!o.isBuffer(e))throw TypeError(\'\\"buffer\\" argument must be a Buffer instance\');if(t>n||te.length)throw RangeError(\\"Index out of range\\")}function _(e,t,r,i,n,s){if(r+i>e.length||r<0)throw RangeError(\\"Index out of range\\")}function E(e,t,r,i,s){return t*=1,r>>>=0,s||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,s){return t*=1,r>>>=0,s||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}o.prototype.write=function(e,t,r,i){if(void 0===t)i=\\"utf8\\",r=this.length,t=0;else if(void 0===r&&\\"string\\"==typeof t)i=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i=\\"utf8\\")):(i=r,r=void 0);else throw Error(\\"Buffer.write(string, encoding, offset[, length]) is no longer supported\\");var n,s,a,o,l,u,h,c,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError(\\"Attempt to write outside buffer bounds\\");i||(i=\\"utf8\\");for(var f=!1;;)switch(i){case\\"hex\\":return function(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=t.length;i>s/2&&(i=s/2);for(var a=0;a>8,n.push(r%256),n.push(i);return n}(e,this.length-h),this,h,c);default:if(f)throw TypeError(\\"Unknown encoding: \\"+i);i=(\\"\\"+i).toLowerCase(),f=!0}},o.prototype.toJSON=function(){return{type:\\"Buffer\\",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||w(e,t,this.length);for(var i=this[e],n=1,s=0;++s>>=0,t>>>=0,r||w(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},o.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var i=this[e],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var i=t,n=1,s=this[e+--i];i>0&&(n*=256);)s+=this[e+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;b(this,e,t,r,n,0)}var s=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;b(this,e,t,r,n,0)}var s=r-1,a=1;for(this[t+s]=255&e;--s>=0&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var n=Math.pow(2,8*r-1);b(this,e,t,r,n-1,-n)}var s=0,a=1,o=0;for(this[t]=255&e;++s>>=0,!i){var n=Math.pow(2,8*r-1);b(this,e,t,r,n-1,-n)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,i){if(!o.isBuffer(e))throw TypeError(\\"argument should be a Buffer\\");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError(\\"Index out of range\\");if(i<0)throw RangeError(\\"sourceEnd out of bounds\\");i>this.length&&(i=this.length),e.length-t=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n},o.prototype.fill=function(e,t,r,i){if(\\"string\\"==typeof e){if(\\"string\\"==typeof t?(i=t,t=0,r=this.length):\\"string\\"==typeof r&&(i=r,r=this.length),void 0!==i&&\\"string\\"!=typeof i)throw TypeError(\\"encoding must be a string\\");if(\\"string\\"==typeof i&&!o.isEncoding(i))throw TypeError(\\"Unknown encoding: \\"+i);if(1===e.length){var n,s=e.charCodeAt(0);(\\"utf8\\"===i&&s<128||\\"latin1\\"===i)&&(e=s)}}else\\"number\\"==typeof e?e&=255:\\"boolean\\"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\\"number\\"==typeof e)for(n=t;n55295&&r<57344){if(!n){if(r>56319||a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error(\\"Invalid code point\\")}return s}function C(e){for(var t=[],r=0;r=t.length)&&!(n>=e.length);++n)t[n+r]=e[n];return n}function R(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e=\\"0123456789abcdef\\",t=Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()},783:function(e,t){t.read=function(e,t,r,i,n){var s,a,o=8*n-i-1,l=(1<>1,h=-7,c=r?n-1:0,d=r?-1:1,f=e[t+c];for(c+=d,s=f&(1<<-h)-1,f>>=-h,h+=o;h>0;s=256*s+e[t+c],c+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=256*a+e[t+c],c+=d,h-=8);if(0===s)s=1-u;else{if(s===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),s-=u}return(f?-1:1)*a*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var a,o,l,u=8*s-n-1,h=(1<>1,d=5960464477539062e-23*(23===n),f=i?0:s-1,p=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+c>=1?t+=d/l:t+=d*Math.pow(2,1-c),t*l>=2&&(a++,l/=2),a+c>=h?(o=0,a=h):a+c>=1?(o=(t*l-1)*Math.pow(2,n),a+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;e[r+f]=255&o,f+=p,o/=256,n-=8);for(a=a<0;e[r+f]=255&a,f+=p,a/=256,u-=8);e[r+f-p]|=128*g}}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var s=r[e]={exports:{}},a=!0;try{t[e](s,s.exports,i),a=!1}finally{a&&delete r[e]}return s.exports}i.ab=\\"//\\",e.exports=i(72)},8275:(e,t,r)=>{\\"use strict\\";r.d(t,{m:()=>s});var i=r(89),n=r(7149),s=new class extends i.Q{#b;#v;#w;constructor(){super(),this.#w=e=>{if(!n.S$&&window.addEventListener){let t=()=>e();return window.addEventListener(\\"visibilitychange\\",t,!1),()=>{window.removeEventListener(\\"visibilitychange\\",t)}}}}onSubscribe(){this.#v||this.setEventListener(this.#w)}onUnsubscribe(){this.hasListeners()||(this.#v?.(),this.#v=void 0)}setEventListener(e){this.#w=e,this.#v?.(),this.#v=e(e=>{\\"boolean\\"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#b!==e&&(this.#b=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return\\"boolean\\"==typeof this.#b?this.#b:globalThis.document?.visibilityState!==\\"hidden\\"}}},8306:(e,t,r)=>{\\"use strict\\";r.d(t,{Zq:()=>s,zs:()=>n});var i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},n=new class{#_=i;#E=!1;setTimeoutProvider(e){this.#_=e}setTimeout(e,t){return this.#_.setTimeout(e,t)}clearTimeout(e){this.#_.clearTimeout(e)}setInterval(e,t){return this.#_.setInterval(e,t)}clearInterval(e){this.#_.clearInterval(e)}};function s(e){setTimeout(e,0)}},8444:(e,t,r)=>{\\"use strict\\";r.d(t,{X:()=>o,k:()=>l});var i=r(7149),n=r(388),s=r(8149),a=r(6305),o=class extends a.k{#I;#T;#S;#t;#n;#h;#C;constructor(e){super(),this.#C=!1,this.#h=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#t=e.client,this.#S=this.#t.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#I=h(this.options),this.state=e.state??this.#I,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#h,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=h(this.options);void 0!==e.data&&(this.setState(u(e.data,e.dataUpdatedAt)),this.#I=e)}}optionalRemove(){this.observers.length||\\"idle\\"!==this.state.fetchStatus||this.#S.remove(this)}setData(e,t){let r=(0,i.pl)(this.state.data,e,this.options);return this.#s({data:r,type:\\"success\\",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#s({type:\\"setState\\",state:e,setStateOptions:t})}cancel(e){let t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(i.lQ).catch(i.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#I)}isActive(){return this.observers.some(e=>!1!==(0,i.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>\\"static\\"===(0,i.d2)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||\\"static\\"!==e&&(!!this.state.isInvalidated||!(0,i.j3)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#S.notify({type:\\"observerAdded\\",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#C?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#S.notify({type:\\"observerRemoved\\",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:\\"invalidate\\"})}async fetch(e,t){let r;if(\\"idle\\"!==this.state.fetchStatus&&this.#n?.status()!==\\"rejected\\"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,a=e=>{Object.defineProperty(e,\\"signal\\",{enumerable:!0,get:()=>(this.#C=!0,n.signal)})},o=()=>{let e,r=(0,i.ZM)(this.options,t),n=(a(e={client:this.#t,queryKey:this.queryKey,meta:this.meta}),e);return(this.#C=!1,this.options.persister)?this.options.persister(r,n,this):r(n)},l=(a(r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#t,state:this.state,fetchFn:o}),r);this.options.behavior?.onFetch(l,this),this.#T=this.state,(\\"idle\\"===this.state.fetchStatus||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:\\"fetch\\",meta:l.fetchOptions?.meta}),this.#n=(0,s.II)({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:e=>{e instanceof s.cc&&e.revert&&this.setState({...this.#T,fetchStatus:\\"idle\\"}),n.abort()},onFail:(e,t)=>{this.#s({type:\\"failed\\",failureCount:e,error:t})},onPause:()=>{this.#s({type:\\"pause\\"})},onContinue:()=>{this.#s({type:\\"continue\\"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{let e=await this.#n.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#S.config.onSuccess?.(e,this),this.#S.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof s.cc){if(e.silent)return this.#n.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#s({type:\\"error\\",error:e}),this.#S.config.onError?.(e,this),this.#S.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case\\"failed\\":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case\\"pause\\":return{...t,fetchStatus:\\"paused\\"};case\\"continue\\":return{...t,fetchStatus:\\"fetching\\"};case\\"fetch\\":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case\\"success\\":let r={...t,...u(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:\\"idle\\",fetchFailureCount:0,fetchFailureReason:null}};return this.#T=e.manual?r:void 0,r;case\\"error\\":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:\\"idle\\",status:\\"error\\"};case\\"invalidate\\":return{...t,isInvalidated:!0};case\\"setState\\":return{...t,...e.state}}};this.state=t(this.state),n.jG.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#S.notify({query:this,type:\\"updated\\",action:e})})}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.v_)(t.networkMode)?\\"fetching\\":\\"paused\\",...void 0===e&&{error:null,status:\\"pending\\"}}}function u(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:\\"success\\"}}function h(e){let t=\\"function\\"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?\\"function\\"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?\\"success\\":\\"pending\\",fetchStatus:\\"idle\\"}}},9979:(e,t,r)=>{\\"use strict\\";var i,n;r.d(t,{$b:()=>i,Vy:()=>h});let s=[];(n=i||(i={}))[n.DEBUG=0]=\\"DEBUG\\",n[n.VERBOSE=1]=\\"VERBOSE\\",n[n.INFO=2]=\\"INFO\\",n[n.WARN=3]=\\"WARN\\",n[n.ERROR=4]=\\"ERROR\\",n[n.SILENT=5]=\\"SILENT\\";let a={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,l={[i.DEBUG]:\\"log\\",[i.VERBOSE]:\\"log\\",[i.INFO]:\\"info\\",[i.WARN]:\\"warn\\",[i.ERROR]:\\"error\\"},u=(e,t,...r)=>{if(t{var t=t=>e(e.s=t);e.O(0,[593,792],()=>(t(92),t(9603))),_N_E=e.O()}]);"},{"name":"_error-de1c64435fe2d9b7.js","path":"apps/web/out/_next/static/chunks/pages/_error-de1c64435fe2d9b7.js","area":"FRONTEND","folder":"PAGES","content":"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[494,731],{2164:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push([\\"/_error\\",function(){return n(5494)}])},5494:(e,t,n)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return h}});let r=n(4252),o=n(7876),i=r._(n(4232)),a=r._(n(8022)),l={400:\\"Bad Request\\",404:\\"This page could not be found\\",405:\\"Method Not Allowed\\",500:\\"Internal Server Error\\"};function s({req:e,res:t,err:n}){return{statusCode:t&&t.statusCode?t.statusCode:n?n.statusCode:404,hostname:window.location.hostname}}let d={fontFamily:\'system-ui,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif,\\"Apple Color Emoji\\",\\"Segoe UI Emoji\\"\',height:\\"100vh\\",textAlign:\\"center\\",display:\\"flex\\",flexDirection:\\"column\\",alignItems:\\"center\\",justifyContent:\\"center\\"},u={lineHeight:\\"48px\\"},c={display:\\"inline-block\\",margin:\\"0 20px 0 0\\",paddingRight:23,fontSize:24,fontWeight:500,verticalAlign:\\"top\\"},f={fontSize:14,fontWeight:400,lineHeight:\\"28px\\"},p={display:\\"inline-block\\"};class h extends i.default.Component{static{this.displayName=\\"ErrorPage\\"}static{this.getInitialProps=s}static{this.origGetInitialProps=s}render(){let{statusCode:e,withDarkMode:t=!0}=this.props,n=this.props.title||l[e]||\\"An unexpected error has occurred\\";return(0,o.jsxs)(\\"div\\",{style:d,children:[(0,o.jsx)(a.default,{children:(0,o.jsx)(\\"title\\",{children:e?`${e}: ${n}`:\\"Application error: a client-side exception has occurred\\"})}),(0,o.jsxs)(\\"div\\",{style:u,children:[(0,o.jsx)(\\"style\\",{dangerouslySetInnerHTML:{__html:`body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}${t?\\"@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\\":\\"\\"}`}}),e?(0,o.jsx)(\\"h1\\",{className:\\"next-error-h1\\",style:c,children:e}):null,(0,o.jsx)(\\"div\\",{style:p,children:(0,o.jsxs)(\\"h2\\",{style:f,children:[this.props.title||e?n:(0,o.jsxs)(o.Fragment,{children:[\\"Application error: a client-side exception has occurred\\",\\" \\",!!this.props.hostname&&(0,o.jsxs)(o.Fragment,{children:[\\"while loading \\",this.props.hostname]}),\\" \\",\\"(see the browser console for more information)\\"]}),\\".\\"]})})]})]})}}(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8022:(e,t,n)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0});var r={default:function(){return y},defaultHead:function(){return c}};for(var o in r)Object.defineProperty(t,o,{enumerable:!0,get:r[o]});let i=n(4252),a=n(8365),l=n(7876),s=a._(n(4232)),d=i._(n(8071)),u=n(6972);function c(){return[(0,l.jsx)(\\"meta\\",{charSet:\\"utf-8\\"},\\"charset\\"),(0,l.jsx)(\\"meta\\",{name:\\"viewport\\",content:\\"width=device-width\\"},\\"viewport\\")]}function f(e,t){return\\"string\\"==typeof t||\\"number\\"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>\\"string\\"==typeof t||\\"number\\"==typeof t?e:e.concat(t),[])):e.concat(t)}n(8912);let p=[\\"name\\",\\"httpEquiv\\",\\"charSet\\",\\"itemProp\\"];function h(e){let t,n,r,o;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,n=new Set,r=new Set,o={},e=>{let i=!0,a=!1;if(e.key&&\\"number\\"!=typeof e.key&&e.key.indexOf(\\"$\\")>0){a=!0;let n=e.key.slice(e.key.indexOf(\\"$\\")+1);t.has(n)?i=!1:t.add(n)}switch(e.type){case\\"title\\":case\\"base\\":n.has(e.type)?i=!1:n.add(e.type);break;case\\"meta\\":for(let t=0,n=p.length;t{let n=e.key||t;return s.default.cloneElement(e,{key:n})})}let y=function({children:e}){let t=(0,s.useContext)(u.HeadManagerContext);return(0,l.jsx)(d.default,{reduceComponentsToState:h,headManager:t,children:e})};(\\"function\\"==typeof t.default||\\"object\\"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,\\"__esModule\\",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8071:(e,t,n)=>{\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),Object.defineProperty(t,\\"default\\",{enumerable:!0,get:function(){return a}});let r=n(4232),o=r.useLayoutEffect,i=r.useEffect;function a(e){let{headManager:t,reduceComponentsToState:n}=e;function a(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return o(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),o(()=>(t&&(t._pendingUpdate=a),()=>{t&&(t._pendingUpdate=a)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}}},e=>{e.O(0,[636,593,792],()=>e(e.s=2164)),_N_E=e.O()}]);"},{"name":"polyfills-42372ed130431b0a.js","path":"apps/web/out/_next/static/chunks/polyfills-42372ed130431b0a.js","area":"FRONTEND","folder":"CHUNKS","content":"!function(){var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function e(t){var e={exports:{}};return t(e,e.exports),e.exports}var r,n,o=function(t){return t&&t.Math===Math&&t},i=o(\\"object\\"==typeof globalThis&&globalThis)||o(\\"object\\"==typeof window&&window)||o(\\"object\\"==typeof self&&self)||o(\\"object\\"==typeof t&&t)||o(\\"object\\"==typeof t&&t)||function(){return this}()||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},u=!a(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),s=!a(function(){var t=function(){}.bind();return\\"function\\"!=typeof t||t.hasOwnProperty(\\"prototype\\")}),c=Function.prototype.call,f=s?c.bind(c):function(){return c.apply(c,arguments)},l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p=h&&!l.call({1:2},1)?function(t){var e=h(this,t);return!!e&&e.enumerable}:l,v={f:p},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g=Function.prototype,y=g.call,m=s&&g.bind.bind(y,y),b=s?m:function(t){return function(){return y.apply(t,arguments)}},w=b({}.toString),S=b(\\"\\".slice),E=function(t){return S(w(t),8,-1)},O=Object,x=b(\\"\\".split),R=a(function(){return!O(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"===E(t)?x(t,\\"\\"):O(t)}:O,P=function(t){return null==t},A=TypeError,j=function(t){if(P(t))throw new A(\\"Can\'t call method on \\"+t);return t},k=function(t){return R(j(t))},I=\\"object\\"==typeof document&&document.all,T=void 0===I&&void 0!==I?function(t){return\\"function\\"==typeof t||t===I}:function(t){return\\"function\\"==typeof t},M=function(t){return\\"object\\"==typeof t?null!==t:T(t)},L=function(t,e){return arguments.length<2?T(r=i[t])?r:void 0:i[t]&&i[t][e];var r},U=b({}.isPrototypeOf),N=i.navigator,C=N&&N.userAgent,_=C?String(C):\\"\\",F=i.process,B=i.Deno,D=F&&F.versions||B&&B.version,z=D&&D.v8;z&&(n=(r=z.split(\\".\\"))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&_&&(!(r=_.match(/Edge\\\\/(\\\\d+)/))||r[1]>=74)&&(r=_.match(/Chrome\\\\/(\\\\d+)/))&&(n=+r[1]);var W=n,q=i.String,H=!!Object.getOwnPropertySymbols&&!a(function(){var t=Symbol(\\"symbol detection\\");return!q(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&W&&W<41}),$=H&&!Symbol.sham&&\\"symbol\\"==typeof Symbol.iterator,K=Object,G=$?function(t){return\\"symbol\\"==typeof t}:function(t){var e=L(\\"Symbol\\");return T(e)&&U(e.prototype,K(t))},V=String,Y=function(t){try{return V(t)}catch(t){return\\"Object\\"}},X=TypeError,J=function(t){if(T(t))return t;throw new X(Y(t)+\\" is not a function\\")},Q=function(t,e){var r=t[e];return P(r)?void 0:J(r)},Z=TypeError,tt=Object.defineProperty,et=function(t,e){try{tt(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e},rt=e(function(t){var e=\\"__core-js_shared__\\",r=t.exports=i[e]||et(e,{});(r.versions||(r.versions=[])).push({version:\\"3.38.1\\",mode:\\"global\\",copyright:\\"© 2014-2024 Denis Pushkarev (zloirock.ru)\\",license:\\"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE\\",source:\\"https://github.com/zloirock/core-js\\"})}),nt=function(t,e){return rt[t]||(rt[t]=e||{})},ot=Object,it=function(t){return ot(j(t))},at=b({}.hasOwnProperty),ut=Object.hasOwn||function(t,e){return at(it(t),e)},st=0,ct=Math.random(),ft=b(1..toString),lt=function(t){return\\"Symbol(\\"+(void 0===t?\\"\\":t)+\\")_\\"+ft(++st+ct,36)},ht=i.Symbol,pt=nt(\\"wks\\"),vt=$?ht.for||ht:ht&&ht.withoutSetter||lt,dt=function(t){return ut(pt,t)||(pt[t]=H&&ut(ht,t)?ht[t]:vt(\\"Symbol.\\"+t)),pt[t]},gt=TypeError,yt=dt(\\"toPrimitive\\"),mt=function(t,e){if(!M(t)||G(t))return t;var r,n=Q(t,yt);if(n){if(void 0===e&&(e=\\"default\\"),r=f(n,t,e),!M(r)||G(r))return r;throw new gt(\\"Can\'t convert object to primitive value\\")}return void 0===e&&(e=\\"number\\"),function(t,e){var r,n;if(\\"string\\"===e&&T(r=t.toString)&&!M(n=f(r,t)))return n;if(T(r=t.valueOf)&&!M(n=f(r,t)))return n;if(\\"string\\"!==e&&T(r=t.toString)&&!M(n=f(r,t)))return n;throw new Z(\\"Can\'t convert object to primitive value\\")}(t,e)},bt=function(t){var e=mt(t,\\"string\\");return G(e)?e:e+\\"\\"},wt=i.document,St=M(wt)&&M(wt.createElement),Et=function(t){return St?wt.createElement(t):{}},Ot=!u&&!a(function(){return 7!==Object.defineProperty(Et(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),xt=Object.getOwnPropertyDescriptor,Rt={f:u?xt:function(t,e){if(t=k(t),e=bt(e),Ot)try{return xt(t,e)}catch(t){}if(ut(t,e))return d(!f(v.f,t,e),t[e])}},Pt=u&&a(function(){return 42!==Object.defineProperty(function(){},\\"prototype\\",{value:42,writable:!1}).prototype}),At=String,jt=TypeError,kt=function(t){if(M(t))return t;throw new jt(At(t)+\\" is not an object\\")},It=TypeError,Tt=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Lt=\\"enumerable\\",Ut=\\"configurable\\",Nt=\\"writable\\",Ct={f:u?Pt?function(t,e,r){if(kt(t),e=bt(e),kt(r),\\"function\\"==typeof t&&\\"prototype\\"===e&&\\"value\\"in r&&Nt in r&&!r[Nt]){var n=Mt(t,e);n&&n[Nt]&&(t[e]=r.value,r={configurable:Ut in r?r[Ut]:n[Ut],enumerable:Lt in r?r[Lt]:n[Lt],writable:!1})}return Tt(t,e,r)}:Tt:function(t,e,r){if(kt(t),e=bt(e),kt(r),Ot)try{return Tt(t,e,r)}catch(t){}if(\\"get\\"in r||\\"set\\"in r)throw new It(\\"Accessors not supported\\");return\\"value\\"in r&&(t[e]=r.value),t}},_t=u?function(t,e,r){return Ct.f(t,e,d(1,r))}:function(t,e,r){return t[e]=r,t},Ft=Function.prototype,Bt=u&&Object.getOwnPropertyDescriptor,Dt=ut(Ft,\\"name\\"),zt={EXISTS:Dt,PROPER:Dt&&\\"something\\"===function(){}.name,CONFIGURABLE:Dt&&(!u||u&&Bt(Ft,\\"name\\").configurable)},Wt=b(Function.toString);T(rt.inspectSource)||(rt.inspectSource=function(t){return Wt(t)});var qt,Ht,$t,Kt=rt.inspectSource,Gt=i.WeakMap,Vt=T(Gt)&&/native code/.test(String(Gt)),Yt=nt(\\"keys\\"),Xt=function(t){return Yt[t]||(Yt[t]=lt(t))},Jt={},Qt=\\"Object already initialized\\",Zt=i.TypeError;if(Vt||rt.state){var te=rt.state||(rt.state=new(0,i.WeakMap));te.get=te.get,te.has=te.has,te.set=te.set,qt=function(t,e){if(te.has(t))throw new Zt(Qt);return e.facade=t,te.set(t,e),e},Ht=function(t){return te.get(t)||{}},$t=function(t){return te.has(t)}}else{var ee=Xt(\\"state\\");Jt[ee]=!0,qt=function(t,e){if(ut(t,ee))throw new Zt(Qt);return e.facade=t,_t(t,ee,e),e},Ht=function(t){return ut(t,ee)?t[ee]:{}},$t=function(t){return ut(t,ee)}}var re,ne={set:qt,get:Ht,has:$t,enforce:function(t){return $t(t)?Ht(t):qt(t,{})},getterFor:function(t){return function(e){var r;if(!M(e)||(r=Ht(e)).type!==t)throw new Zt(\\"Incompatible receiver, \\"+t+\\" required\\");return r}}},oe=e(function(t){var e=zt.CONFIGURABLE,r=ne.enforce,n=ne.get,o=String,i=Object.defineProperty,s=b(\\"\\".slice),c=b(\\"\\".replace),f=b([].join),l=u&&!a(function(){return 8!==i(function(){},\\"length\\",{value:8}).length}),h=String(String).split(\\"String\\"),p=t.exports=function(t,n,a){\\"Symbol(\\"===s(o(n),0,7)&&(n=\\"[\\"+c(o(n),/^Symbol\\\\(([^)]*)\\\\).*$/,\\"$1\\")+\\"]\\"),a&&a.getter&&(n=\\"get \\"+n),a&&a.setter&&(n=\\"set \\"+n),(!ut(t,\\"name\\")||e&&t.name!==n)&&(u?i(t,\\"name\\",{value:n,configurable:!0}):t.name=n),l&&a&&ut(a,\\"arity\\")&&t.length!==a.arity&&i(t,\\"length\\",{value:a.arity});try{a&&ut(a,\\"constructor\\")&&a.constructor?u&&i(t,\\"prototype\\",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var p=r(t);return ut(p,\\"source\\")||(p.source=f(h,\\"string\\"==typeof n?n:\\"\\")),t};Function.prototype.toString=p(function(){return T(this)&&n(this).source||Kt(this)},\\"toString\\")}),ie=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(T(r)&&oe(r,i,n),n.global)o?t[e]=r:et(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:Ct.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},ae=Math.ceil,ue=Math.floor,se=Math.trunc||function(t){var e=+t;return(e>0?ue:ae)(e)},ce=function(t){var e=+t;return e!=e||0===e?0:se(e)},fe=Math.max,le=Math.min,he=function(t,e){var r=ce(t);return r<0?fe(r+e,0):le(r,e)},pe=Math.min,ve=function(t){var e=ce(t);return e>0?pe(e,9007199254740991):0},de=function(t){return ve(t.length)},ge=function(t){return function(e,r,n){var o=k(e),i=de(o);if(0===i)return!t&&-1;var a,u=he(n,i);if(t&&r!=r){for(;i>u;)if((a=o[u++])!=a)return!0}else for(;i>u;u++)if((t||u in o)&&o[u]===r)return t||u||0;return!t&&-1}},ye={includes:ge(!0),indexOf:ge(!1)},me=ye.indexOf,be=b([].push),we=function(t,e){var r,n=k(t),o=0,i=[];for(r in n)!ut(Jt,r)&&ut(n,r)&&be(i,r);for(;e.length>o;)ut(n,r=e[o++])&&(~me(i,r)||be(i,r));return i},Se=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"],Ee=Se.concat(\\"length\\",\\"prototype\\"),Oe={f:Object.getOwnPropertyNames||function(t){return we(t,Ee)}},xe={f:Object.getOwnPropertySymbols},Re=b([].concat),Pe=L(\\"Reflect\\",\\"ownKeys\\")||function(t){var e=Oe.f(kt(t)),r=xe.f;return r?Re(e,r(t)):e},Ae=function(t,e,r){for(var n=Pe(e),o=Ct.f,i=Rt.f,a=0;aa;)Ct.f(t,r=o[a++],n[r]);return t},Be={f:Fe},De=L(\\"document\\",\\"documentElement\\"),ze=\\"prototype\\",We=\\"script\\",qe=Xt(\\"IE_PROTO\\"),He=function(){},$e=function(t){return\\"<\\"+We+\\">\\"+t+\\"\\"},Ke=function(t){t.write($e(\\"\\")),t.close();var e=t.parentWindow.Object;return t=null,e},Ge=function(){try{re=new ActiveXObject(\\"htmlfile\\")}catch(t){}var t,e,r;Ge=\\"undefined\\"!=typeof document?document.domain&&re?Ke(re):(e=Et(\\"iframe\\"),r=\\"java\\"+We+\\":\\",e.style.display=\\"none\\",De.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write($e(\\"document.F=Object\\")),t.close(),t.F):Ke(re);for(var n=Se.length;n--;)delete Ge[ze][Se[n]];return Ge()};Jt[qe]=!0;var Ve=Object.create||function(t,e){var r;return null!==t?(He[ze]=kt(t),r=new He,He[ze]=null,r[qe]=t):r=Ge(),void 0===e?r:Be.f(r,e)},Ye=Ct.f,Xe=dt(\\"unscopables\\"),Je=Array.prototype;void 0===Je[Xe]&&Ye(Je,Xe,{configurable:!0,value:Ve(null)});var Qe=function(t){Je[Xe][t]=!0};Ce({target:\\"Array\\",proto:!0},{at:function(t){var e=it(this),r=de(e),n=ce(t),o=n>=0?n:r+n;return o<0||o>=r?void 0:e[o]}}),Qe(\\"at\\");var Ze=function(t,e){return b(i[t].prototype[e])},tr=(Ze(\\"Array\\",\\"at\\"),TypeError),er=function(t,e){if(!delete t[e])throw new tr(\\"Cannot delete property \\"+Y(e)+\\" of \\"+Y(t))},rr=Math.min,nr=[].copyWithin||function(t,e){var r=it(this),n=de(r),o=he(t,n),i=he(e,n),a=arguments.length>2?arguments[2]:void 0,u=rr((void 0===a?n:he(a,n))-i,n-o),s=1;for(i0;)i in r?r[o]=r[i]:er(r,o),o+=s,i+=s;return r};Ce({target:\\"Array\\",proto:!0},{copyWithin:nr}),Qe(\\"copyWithin\\"),Ze(\\"Array\\",\\"copyWithin\\"),Ce({target:\\"Array\\",proto:!0},{fill:function(t){for(var e=it(this),r=de(e),n=arguments.length,o=he(n>1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,a=void 0===i?r:he(i,r);a>o;)e[o++]=t;return e}}),Qe(\\"fill\\"),Ze(\\"Array\\",\\"fill\\");var or=function(t){if(\\"Function\\"===E(t))return b(t)},ir=or(or.bind),ar=function(t,e){return J(t),void 0===e?t:s?ir(t,e):function(){return t.apply(e,arguments)}},ur=Array.isArray||function(t){return\\"Array\\"===E(t)},sr={};sr[dt(\\"toStringTag\\")]=\\"z\\";var cr=\\"[object z]\\"===String(sr),fr=dt(\\"toStringTag\\"),lr=Object,hr=\\"Arguments\\"===E(function(){return arguments}()),pr=cr?E:function(t){var e,r,n;return void 0===t?\\"Undefined\\":null===t?\\"Null\\":\\"string\\"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=lr(t),fr))?r:hr?E(e):\\"Object\\"===(n=E(e))&&T(e.callee)?\\"Arguments\\":n},vr=function(){},dr=L(\\"Reflect\\",\\"construct\\"),gr=/^\\\\s*(?:class|function)\\\\b/,yr=b(gr.exec),mr=!gr.test(vr),br=function(t){if(!T(t))return!1;try{return dr(vr,[],t),!0}catch(t){return!1}},wr=function(t){if(!T(t))return!1;switch(pr(t)){case\\"AsyncFunction\\":case\\"GeneratorFunction\\":case\\"AsyncGeneratorFunction\\":return!1}try{return mr||!!yr(gr,Kt(t))}catch(t){return!0}};wr.sham=!0;var Sr=!dr||a(function(){var t;return br(br.call)||!br(Object)||!br(function(){t=!0})||t})?wr:br,Er=dt(\\"species\\"),Or=Array,xr=function(t,e){return new(function(t){var e;return ur(t)&&(Sr(e=t.constructor)&&(e===Or||ur(e.prototype))||M(e)&&null===(e=e[Er]))&&(e=void 0),void 0===e?Or:e}(t))(0===e?0:e)},Rr=b([].push),Pr=function(t){var e=1===t,r=2===t,n=3===t,o=4===t,i=6===t,a=7===t,u=5===t||i;return function(s,c,f,l){for(var h,p,v=it(s),d=R(v),g=de(d),y=ar(c,f),m=0,b=l||xr,w=e?b(s,g):r||a?b(s,0):void 0;g>m;m++)if((u||m in d)&&(p=y(h=d[m],m,v),t))if(e)w[m]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:Rr(w,h)}else switch(t){case 4:return!1;case 7:Rr(w,h)}return i?-1:n||o?o:w}},Ar={forEach:Pr(0),map:Pr(1),filter:Pr(2),some:Pr(3),every:Pr(4),find:Pr(5),findIndex:Pr(6),filterReject:Pr(7)},jr=Ar.find,kr=\\"find\\",Ir=!0;kr in[]&&Array(1)[kr](function(){Ir=!1}),Ce({target:\\"Array\\",proto:!0,forced:Ir},{find:function(t){return jr(this,t,arguments.length>1?arguments[1]:void 0)}}),Qe(kr),Ze(\\"Array\\",\\"find\\");var Tr=Ar.findIndex,Mr=\\"findIndex\\",Lr=!0;Mr in[]&&Array(1)[Mr](function(){Lr=!1}),Ce({target:\\"Array\\",proto:!0,forced:Lr},{findIndex:function(t){return Tr(this,t,arguments.length>1?arguments[1]:void 0)}}),Qe(Mr),Ze(\\"Array\\",\\"findIndex\\");var Ur=TypeError,Nr=function(t){if(t>9007199254740991)throw Ur(\\"Maximum allowed index exceeded\\");return t},Cr=function(t,e,r,n,o,i,a,u){for(var s,c,f=o,l=0,h=!!a&&ar(a,u);l0&&ur(s)?(c=de(s),f=Cr(t,e,s,c,f,i-1)-1):(Nr(f+1),t[f]=s),f++),l++;return f},_r=Cr;Ce({target:\\"Array\\",proto:!0},{flatMap:function(t){var e,r=it(this),n=de(r);return J(t),(e=xr(r,0)).length=_r(e,r,r,n,0,1,t,arguments.length>1?arguments[1]:void 0),e}}),Qe(\\"flatMap\\"),Ze(\\"Array\\",\\"flatMap\\"),Ce({target:\\"Array\\",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=it(this),r=de(e),n=xr(e,0);return n.length=_r(n,e,e,r,0,void 0===t?1:ce(t)),n}}),Qe(\\"flat\\"),Ze(\\"Array\\",\\"flat\\");var Fr,Br,Dr,zr=String,Wr=function(t){if(\\"Symbol\\"===pr(t))throw new TypeError(\\"Cannot convert a Symbol value to a string\\");return zr(t)},qr=b(\\"\\".charAt),Hr=b(\\"\\".charCodeAt),$r=b(\\"\\".slice),Kr=function(t){return function(e,r){var n,o,i=Wr(j(e)),a=ce(r),u=i.length;return a<0||a>=u?t?\\"\\":void 0:(n=Hr(i,a))<55296||n>56319||a+1===u||(o=Hr(i,a+1))<56320||o>57343?t?qr(i,a):n:t?$r(i,a,a+2):o-56320+(n-55296<<10)+65536}},Gr={codeAt:Kr(!1),charAt:Kr(!0)},Vr=!a(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Yr=Xt(\\"IE_PROTO\\"),Xr=Object,Jr=Xr.prototype,Qr=Vr?Xr.getPrototypeOf:function(t){var e=it(t);if(ut(e,Yr))return e[Yr];var r=e.constructor;return T(r)&&e instanceof r?r.prototype:e instanceof Xr?Jr:null},Zr=dt(\\"iterator\\"),tn=!1;[].keys&&(\\"next\\"in(Dr=[].keys())?(Br=Qr(Qr(Dr)))!==Object.prototype&&(Fr=Br):tn=!0);var en=!M(Fr)||a(function(){var t={};return Fr[Zr].call(t)!==t});en&&(Fr={}),T(Fr[Zr])||ie(Fr,Zr,function(){return this});var rn={IteratorPrototype:Fr,BUGGY_SAFARI_ITERATORS:tn},nn=Ct.f,on=dt(\\"toStringTag\\"),an=function(t,e,r){t&&!r&&(t=t.prototype),t&&!ut(t,on)&&nn(t,on,{configurable:!0,value:e})},un={},sn=rn.IteratorPrototype,cn=function(){return this},fn=function(t,e,r,n){var o=e+\\" Iterator\\";return t.prototype=Ve(sn,{next:d(+!n,r)}),an(t,o,!1),un[o]=cn,t},ln=function(t,e,r){try{return b(J(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}},hn=String,pn=TypeError,vn=function(t){if(function(t){return M(t)||null===t}(t))return t;throw new pn(\\"Can\'t set \\"+hn(t)+\\" as a prototype\\")},dn=Object.setPrototypeOf||(\\"__proto__\\"in{}?function(){var t,e=!1,r={};try{(t=ln(Object.prototype,\\"__proto__\\",\\"set\\"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return j(r),vn(n),M(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),gn=zt.PROPER,yn=zt.CONFIGURABLE,mn=rn.IteratorPrototype,bn=rn.BUGGY_SAFARI_ITERATORS,wn=dt(\\"iterator\\"),Sn=\\"keys\\",En=\\"values\\",On=\\"entries\\",xn=function(){return this},Rn=function(t,e,r,n,o,i,a){fn(r,e,n);var u,s,c,l=function(t){if(t===o&&g)return g;if(!bn&&t&&t in v)return v[t];switch(t){case Sn:case En:case On:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+\\" Iterator\\",p=!1,v=t.prototype,d=v[wn]||v[\\"@@iterator\\"]||o&&v[o],g=!bn&&d||l(o),y=\\"Array\\"===e&&v.entries||d;if(y&&(u=Qr(y.call(new t)))!==Object.prototype&&u.next&&(Qr(u)!==mn&&(dn?dn(u,mn):T(u[wn])||ie(u,wn,xn)),an(u,h,!0)),gn&&o===En&&d&&d.name!==En&&(yn?_t(v,\\"name\\",En):(p=!0,g=function(){return f(d,this)})),o)if(s={values:l(En),keys:i?g:l(Sn),entries:l(On)},a)for(c in s)(bn||p||!(c in v))&&ie(v,c,s[c]);else Ce({target:e,proto:!0,forced:bn||p},s);return v[wn]!==g&&ie(v,wn,g,{name:o}),un[e]=g,s},Pn=function(t,e){return{value:t,done:e}},An=Gr.charAt,jn=\\"String Iterator\\",kn=ne.set,In=ne.getterFor(jn);Rn(String,\\"String\\",function(t){kn(this,{type:jn,string:Wr(t),index:0})},function(){var t,e=In(this),r=e.string,n=e.index;return n>=r.length?Pn(void 0,!0):(t=An(r,n),e.index+=t.length,Pn(t,!1))});var Tn=function(t,e,r){var n,o;kt(t);try{if(!(n=Q(t,\\"return\\"))){if(\\"throw\\"===e)throw r;return r}n=f(n,t)}catch(t){o=!0,n=t}if(\\"throw\\"===e)throw r;if(o)throw n;return kt(n),r},Mn=function(t,e,r,n){try{return n?e(kt(r)[0],r[1]):e(r)}catch(e){Tn(t,\\"throw\\",e)}},Ln=dt(\\"iterator\\"),Un=Array.prototype,Nn=function(t){return void 0!==t&&(un.Array===t||Un[Ln]===t)},Cn=function(t,e,r){u?Ct.f(t,e,d(0,r)):t[e]=r},_n=dt(\\"iterator\\"),Fn=function(t){if(!P(t))return Q(t,_n)||Q(t,\\"@@iterator\\")||un[pr(t)]},Bn=TypeError,Dn=function(t,e){var r=arguments.length<2?Fn(t):e;if(J(r))return kt(f(r,t));throw new Bn(Y(t)+\\" is not iterable\\")},zn=Array,Wn=function(t){var e=it(t),r=Sr(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=ar(o,n>2?arguments[2]:void 0));var a,u,s,c,l,h,p=Fn(e),v=0;if(!p||this===zn&&Nn(p))for(a=de(e),u=r?new this(a):zn(a);a>v;v++)h=i?o(e[v],v):e[v],Cn(u,v,h);else for(u=r?new this:[],l=(c=Dn(e,p)).next;!(s=f(l,c)).done;v++)h=i?Mn(c,o,[s.value,v],!0):s.value,Cn(u,v,h);return u.length=v,u},qn=dt(\\"iterator\\"),Hn=!1;try{var $n=0,Kn={next:function(){return{done:!!$n++}},return:function(){Hn=!0}};Kn[qn]=function(){return this},Array.from(Kn,function(){throw 2})}catch(t){}var Gn=function(t,e){try{if(!e&&!Hn)return!1}catch(t){return!1}var r=!1;try{var n={};n[qn]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},Vn=!Gn(function(t){Array.from(t)});Ce({target:\\"Array\\",stat:!0,forced:Vn},{from:Wn});var Yn=i,Xn=ye.includes,Jn=a(function(){return!Array(1).includes()});Ce({target:\\"Array\\",proto:!0,forced:Jn},{includes:function(t){return Xn(this,t,arguments.length>1?arguments[1]:void 0)}}),Qe(\\"includes\\"),Ze(\\"Array\\",\\"includes\\");var Qn=Ct.f,Zn=\\"Array Iterator\\",to=ne.set,eo=ne.getterFor(Zn),ro=Rn(Array,\\"Array\\",function(t,e){to(this,{type:Zn,target:k(t),index:0,kind:e})},function(){var t=eo(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Pn(void 0,!0);switch(t.kind){case\\"keys\\":return Pn(r,!1);case\\"values\\":return Pn(e[r],!1)}return Pn([r,e[r]],!1)},\\"values\\"),no=un.Arguments=un.Array;if(Qe(\\"keys\\"),Qe(\\"values\\"),Qe(\\"entries\\"),u&&\\"values\\"!==no.name)try{Qn(no,\\"name\\",{value:\\"values\\"})}catch(t){}cr||ie(Object.prototype,\\"toString\\",cr?{}.toString:function(){return\\"[object \\"+pr(this)+\\"]\\"},{unsafe:!0}),Ze(\\"Array\\",\\"values\\");var oo=Array,io=a(function(){function t(){}return!(oo.of.call(t)instanceof t)});Ce({target:\\"Array\\",stat:!0,forced:io},{of:function(){for(var t=0,e=arguments.length,r=new(Sr(this)?this:oo)(e);e>t;)Cn(r,t,arguments[t++]);return r.length=e,r}});var ao=dt(\\"hasInstance\\"),uo=Function.prototype;ao in uo||Ct.f(uo,ao,{value:oe(function(t){if(!T(this)||!M(t))return!1;var e=this.prototype;return M(e)?U(e,t):t instanceof this},ao)}),dt(\\"hasInstance\\");var so=function(t,e,r){return r.get&&oe(r.get,e,{getter:!0}),r.set&&oe(r.set,e,{setter:!0}),Ct.f(t,e,r)},co=zt.EXISTS,fo=Function.prototype,lo=b(fo.toString),ho=/function\\\\b(?:\\\\s|\\\\/\\\\*[\\\\S\\\\s]*?\\\\*\\\\/|\\\\/\\\\/[^\\\\n\\\\r]*[\\\\n\\\\r]+)*([^\\\\s(/]*)/,po=b(ho.exec);u&&!co&&so(fo,\\"name\\",{configurable:!0,get:function(){try{return po(ho,lo(this))[1]}catch(t){return\\"\\"}}});var vo=b([].slice),go=Oe.f,yo=\\"object\\"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],mo={f:function(t){return yo&&\\"Window\\"===E(t)?function(t){try{return go(t)}catch(t){return vo(yo)}}(t):go(k(t))}},bo=a(function(){if(\\"function\\"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,\\"a\\",{value:8})}}),wo=Object.isExtensible,So=a(function(){wo(1)})||bo?function(t){return!!M(t)&&(!bo||\\"ArrayBuffer\\"!==E(t))&&(!wo||wo(t))}:wo,Eo=!a(function(){return Object.isExtensible(Object.preventExtensions({}))}),Oo=e(function(t){var e=Ct.f,r=!1,n=lt(\\"meta\\"),o=0,i=function(t){e(t,n,{value:{objectID:\\"O\\"+o++,weakData:{}}})},a=t.exports={enable:function(){a.enable=function(){},r=!0;var t=Oe.f,e=b([].splice),o={};o[n]=1,t(o).length&&(Oe.f=function(r){for(var o=t(r),i=0,a=o.length;ii;i++)if((u=y(t[i]))&&U(Po,u))return u;return new Ro(!1)}n=Dn(t,o)}for(s=h?t.next:n.next;!(c=f(s,n)).done;){try{u=y(c.value)}catch(t){Tn(n,\\"throw\\",t)}if(\\"object\\"==typeof u&&u&&U(Po,u))return u}return new Ro(!1)},jo=TypeError,ko=function(t,e){if(U(e,t))return t;throw new jo(\\"Incorrect invocation\\")},Io=function(t,e,r){var n,o;return dn&&T(n=e.constructor)&&n!==r&&M(o=n.prototype)&&o!==r.prototype&&dn(t,o),t},To=function(t,e,r){var n=-1!==t.indexOf(\\"Map\\"),o=-1!==t.indexOf(\\"Weak\\"),u=n?\\"set\\":\\"add\\",s=i[t],c=s&&s.prototype,f=s,l={},h=function(t){var e=b(c[t]);ie(c,t,\\"add\\"===t?function(t){return e(this,0===t?0:t),this}:\\"delete\\"===t?function(t){return!(o&&!M(t))&&e(this,0===t?0:t)}:\\"get\\"===t?function(t){return o&&!M(t)?void 0:e(this,0===t?0:t)}:\\"has\\"===t?function(t){return!(o&&!M(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(Ue(t,!T(s)||!(o||c.forEach&&!a(function(){(new s).entries().next()}))))f=r.getConstructor(e,t,n,u),Oo.enable();else if(Ue(t,!0)){var p=new f,v=p[u](o?{}:-0,1)!==p,d=a(function(){p.has(1)}),g=Gn(function(t){new s(t)}),y=!o&&a(function(){for(var t=new s,e=5;e--;)t[u](e,e);return!t.has(-0)});g||((f=e(function(t,e){ko(t,c);var r=Io(new s,t,f);return P(e)||Ao(e,r[u],{that:r,AS_ENTRIES:n}),r})).prototype=c,c.constructor=f),(d||y)&&(h(\\"delete\\"),h(\\"has\\"),n&&h(\\"get\\")),(y||v)&&h(u),o&&c.clear&&delete c.clear}return l[t]=f,Ce({global:!0,constructor:!0,forced:f!==s},l),an(f,t),o||r.setStrong(f,t,n),f},Mo=function(t,e,r){for(var n in e)ie(t,n,e[n],r);return t},Lo=dt(\\"species\\"),Uo=function(t){var e=L(t);u&&e&&!e[Lo]&&so(e,Lo,{configurable:!0,get:function(){return this}})},No=Oo.fastKey,Co=ne.set,_o=ne.getterFor,Fo={getConstructor:function(t,e,r,n){var o=t(function(t,o){ko(t,i),Co(t,{type:e,index:Ve(null),first:null,last:null,size:0}),u||(t.size=0),P(o)||Ao(o,t[n],{that:t,AS_ENTRIES:r})}),i=o.prototype,a=_o(e),s=function(t,e,r){var n,o,i=a(t),s=c(t,e);return s?s.value=r:(i.last=s={index:o=No(e,!0),key:e,value:r,previous:n=i.last,next:null,removed:!1},i.first||(i.first=s),n&&(n.next=s),u?i.size++:t.size++,\\"F\\"!==o&&(i.index[o]=s)),t},c=function(t,e){var r,n=a(t),o=No(e);if(\\"F\\"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key===e)return r};return Mo(i,{clear:function(){for(var t=a(this),e=t.first;e;)e.removed=!0,e.previous&&(e.previous=e.previous.next=null),e=e.next;t.first=t.last=null,t.index=Ve(null),u?t.size=0:this.size=0},delete:function(t){var e=this,r=a(e),n=c(e,t);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first===n&&(r.first=o),r.last===n&&(r.last=i),u?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=a(this),n=ar(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Mo(i,r?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),u&&so(i,\\"size\\",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(t,e,r){var n=e+\\" Iterator\\",o=_o(e),i=_o(n);Rn(t,e,function(t,e){Co(this,{type:n,target:t,state:o(t),kind:e,last:null})},function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?Pn(\\"keys\\"===e?r.key:\\"values\\"===e?r.value:[r.key,r.value],!1):(t.target=null,Pn(void 0,!0))},r?\\"entries\\":\\"values\\",!r,!0),Uo(e)}};To(\\"Map\\",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Fo);var Bo=Map.prototype,Do={Map:Map,set:b(Bo.set),get:b(Bo.get),has:b(Bo.has),remove:b(Bo.delete),proto:Bo},zo=Do.Map,Wo=Do.has,qo=Do.get,Ho=Do.set,$o=b([].push),Ko=a(function(){return 1!==zo.groupBy(\\"ab\\",function(t){return t}).get(\\"a\\").length});Ce({target:\\"Map\\",stat:!0,forced:Ko},{groupBy:function(t,e){j(t),J(e);var r=new zo,n=0;return Ao(t,function(t){var o=e(t,n++);Wo(r,o)?$o(qo(r,o),t):Ho(r,o,[t])}),r}});var Go={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Vo=Et(\\"span\\").classList,Yo=Vo&&Vo.constructor&&Vo.constructor.prototype,Xo=Yo===Object.prototype?void 0:Yo,Jo=dt(\\"iterator\\"),Qo=ro.values,Zo=function(t,e){if(t){if(t[Jo]!==Qo)try{_t(t,Jo,Qo)}catch(e){t[Jo]=Qo}if(an(t,e,!0),Go[e])for(var r in ro)if(t[r]!==ro[r])try{_t(t,r,ro[r])}catch(e){t[r]=ro[r]}}};for(var ti in Go)Zo(i[ti]&&i[ti].prototype,ti);Zo(Xo,\\"DOMTokenList\\");var ei=function(t,e,r){return function(n){var o=it(n),i=arguments.length,a=i>1?arguments[1]:void 0,u=void 0!==a,s=u?ar(a,i>2?arguments[2]:void 0):void 0,c=new t,f=0;return Ao(o,function(t){var n=u?s(t,f++):t;r?e(c,kt(n)[0],n[1]):e(c,n)}),c}};Ce({target:\\"Map\\",stat:!0,forced:!0},{from:ei(Do.Map,Do.set,!0)});var ri=function(t,e,r){return function(){for(var n=new t,o=arguments.length,i=0;i1?arguments[1]:void 0);return!1!==di(e,function(t,n){if(!r(t,n,e))return!1},!0)}});var gi=Do.Map,yi=Do.set;Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{filter:function(t){var e=oi(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=new gi;return di(e,function(t,o){r(t,o,e)&&yi(n,o,t)}),n}}),Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{find:function(t){var e=oi(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=di(e,function(t,n){if(r(t,n,e))return{value:t}},!0);return n&&n.value}}),Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=oi(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=di(e,function(t,n){if(r(t,n,e))return{key:n}},!0);return n&&n.key}}),Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{includes:function(t){return!0===di(oi(this),function(e){if((r=e)===(n=t)||r!=r&&n!=n)return!0;var r,n},!0)}});var mi=Do.Map;Ce({target:\\"Map\\",stat:!0,forced:!0},{keyBy:function(t,e){var r=new(T(this)?this:mi);J(e);var n=J(r.set);return Ao(t,function(t){f(n,r,e(t),t)}),r}}),Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=di(oi(this),function(e,r){if(e===t)return{key:r}},!0);return e&&e.key}});var bi=Do.Map,wi=Do.set;Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=oi(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=new bi;return di(e,function(t,o){wi(n,r(t,o,e),t)}),n}});var Si=Do.Map,Ei=Do.set;Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=oi(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=new Si;return di(e,function(t,o){Ei(n,o,r(t,o,e))}),n}});var Oi=Do.set;Ce({target:\\"Map\\",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=oi(this),r=arguments.length,n=0;n1?arguments[1]:void 0);return!0===di(e,function(t,n){if(r(t,n,e))return!0},!0)}});var Ri=TypeError,Pi=Do.get,Ai=Do.has,ji=Do.set;Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=oi(this),n=arguments.length;J(e);var o=Ai(r,t);if(!o&&n<3)throw new Ri(\\"Updating absent value\\");var i=o?Pi(r,t):J(n>2?arguments[2]:void 0)(t,r);return ji(r,t,e(i,t,r)),r}});var ki=TypeError,Ii=function(t,e){var r,n=kt(this),o=J(n.get),i=J(n.has),a=J(n.set),u=arguments.length>2?arguments[2]:void 0;if(!T(e)&&!T(u))throw new ki(\\"At least one callback required\\");return f(i,n,t)?(r=f(o,n,t),T(e)&&(r=e(r),f(a,n,t,r))):T(u)&&(r=u(),f(a,n,t,r)),r};Ce({target:\\"Map\\",proto:!0,real:!0,forced:!0},{upsert:Ii}),Ce({target:\\"Map\\",proto:!0,real:!0,name:\\"upsert\\",forced:!0},{updateOrInsert:Ii});var Ti=b(1..valueOf),Mi=\\"\\\\t\\\\n\\\\v\\\\f\\\\r                 \\\\u2028\\\\u2029\\\\ufeff\\",Li=b(\\"\\".replace),Ui=RegExp(\\"^[\\"+Mi+\\"]+\\"),Ni=RegExp(\\"(^|[^\\"+Mi+\\"])[\\"+Mi+\\"]+$\\"),Ci=function(t){return function(e){var r=Wr(j(e));return 1&t&&(r=Li(r,Ui,\\"\\")),2&t&&(r=Li(r,Ni,\\"$1\\")),r}},_i={start:Ci(1),end:Ci(2),trim:Ci(3)},Fi=Oe.f,Bi=Rt.f,Di=Ct.f,zi=_i.trim,Wi=\\"Number\\",qi=i[Wi],Hi=qi.prototype,$i=i.TypeError,Ki=b(\\"\\".slice),Gi=b(\\"\\".charCodeAt),Vi=Ue(Wi,!qi(\\" 0o1\\")||!qi(\\"0b1\\")||qi(\\"+0x1\\")),Yi=function(t){var e,r=arguments.length<1?0:qi(function(t){var e=mt(t,\\"number\\");return\\"bigint\\"==typeof e?e:function(t){var e,r,n,o,i,a,u,s,c=mt(t,\\"number\\");if(G(c))throw new $i(\\"Cannot convert a Symbol value to a number\\");if(\\"string\\"==typeof c&&c.length>2)if(c=zi(c),43===(e=Gi(c,0))||45===e){if(88===(r=Gi(c,2))||120===r)return NaN}else if(48===e){switch(Gi(c,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(a=(i=Ki(c,2)).length,u=0;uo)return NaN;return parseInt(i,n)}return+c}(e)}(t));return U(Hi,e=this)&&a(function(){Ti(e)})?Io(Object(r),this,Yi):r};Yi.prototype=Hi,Vi&&(Hi.constructor=Yi),Ce({global:!0,constructor:!0,wrap:!0,forced:Vi},{Number:Yi}),Vi&&function(t,e){for(var r,n=u?Fi(e):\\"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range\\".split(\\",\\"),o=0;n.length>o;o++)ut(e,r=n[o])&&!ut(t,r)&&Di(t,r,Bi(e,r))}(Yn[Wi],qi),Ce({target:\\"Number\\",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)});var Xi=i.isFinite;Ce({target:\\"Number\\",stat:!0},{isFinite:Number.isFinite||function(t){return\\"number\\"==typeof t&&Xi(t)}});var Ji=Math.floor,Qi=Number.isInteger||function(t){return!M(t)&&isFinite(t)&&Ji(t)===t};Ce({target:\\"Number\\",stat:!0},{isInteger:Qi}),Ce({target:\\"Number\\",stat:!0},{isNaN:function(t){return t!=t}});var Zi=Math.abs;Ce({target:\\"Number\\",stat:!0},{isSafeInteger:function(t){return Qi(t)&&Zi(t)<=9007199254740991}}),Ce({target:\\"Number\\",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991}),Ce({target:\\"Number\\",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991});var ta=_i.trim,ea=b(\\"\\".charAt),ra=i.parseFloat,na=i.Symbol,oa=na&&na.iterator,ia=1/ra(Mi+\\"-0\\")!=-Infinity||oa&&!a(function(){ra(Object(oa))})?function(t){var e=ta(Wr(t)),r=ra(e);return 0===r&&\\"-\\"===ea(e,0)?-0:r}:ra;Ce({target:\\"Number\\",stat:!0,forced:Number.parseFloat!==ia},{parseFloat:ia});var aa=_i.trim,ua=i.parseInt,sa=i.Symbol,ca=sa&&sa.iterator,fa=/^[+-]?0x/i,la=b(fa.exec),ha=8!==ua(Mi+\\"08\\")||22!==ua(Mi+\\"0x16\\")||ca&&!a(function(){ua(Object(ca))})?function(t,e){var r=aa(Wr(t));return ua(r,e>>>0||(la(fa,r)?16:10))}:ua;Ce({target:\\"Number\\",stat:!0,forced:Number.parseInt!==ha},{parseInt:ha});var pa=b(v.f),va=b([].push),da=u&&a(function(){var t=Object.create(null);return t[2]=2,!pa(t,2)}),ga=function(t){return function(e){for(var r,n=k(e),o=_e(n),i=da&&null===Qr(n),a=o.length,s=0,c=[];a>s;)r=o[s++],u&&!(i?r in n:pa(n,r))||va(c,t?[r,n[r]]:n[r]);return c}},ya={entries:ga(!0),values:ga(!1)},ma=ya.entries;Ce({target:\\"Object\\",stat:!0},{entries:function(t){return ma(t)}}),Ce({target:\\"Object\\",stat:!0,sham:!u},{getOwnPropertyDescriptors:function(t){for(var e,r,n=k(t),o=Rt.f,i=Pe(n),a={},u=0;i.length>u;)void 0!==(r=o(n,e=i[u++]))&&Cn(a,e,r);return a}});var ba=a(function(){_e(1)});Ce({target:\\"Object\\",stat:!0,forced:ba},{keys:function(t){return _e(it(t))}});var wa=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};Ce({target:\\"Object\\",stat:!0},{is:wa});var Sa=ya.values;Ce({target:\\"Object\\",stat:!0},{values:function(t){return Sa(t)}}),Ce({target:\\"Object\\",stat:!0},{hasOwn:ut});var Ea=Function.prototype,Oa=Ea.apply,xa=Ea.call,Ra=\\"object\\"==typeof Reflect&&Reflect.apply||(s?xa.bind(Oa):function(){return xa.apply(Oa,arguments)}),Pa=!a(function(){Reflect.apply(function(){})});Ce({target:\\"Reflect\\",stat:!0,forced:Pa},{apply:function(t,e,r){return Ra(J(t),e,kt(r))}});var Aa=Function,ja=b([].concat),ka=b([].join),Ia={},Ta=s?Aa.bind:function(t){var e=J(this),r=e.prototype,n=vo(arguments,1),o=function(){var r=ja(n,vo(arguments));return this instanceof o?function(t,e,r){if(!ut(Ia,e)){for(var n=[],o=0;ob)\\",\\"g\\");return\\"b\\"!==t.exec(\\"b\\").groups.a||\\"bc\\"!==\\"b\\".replace(t,\\"$c\\")}),gs=Oe.f,ys=ne.enforce,ms=dt(\\"match\\"),bs=i.RegExp,ws=bs.prototype,Ss=i.SyntaxError,Es=b(ws.exec),Os=b(\\"\\".charAt),xs=b(\\"\\".replace),Rs=b(\\"\\".indexOf),Ps=b(\\"\\".slice),As=/^\\\\?<[^\\\\s\\\\d!#%&*+<=>@^][^\\\\s!#%&*+<=>@^]*>/,js=/a/g,ks=/a/g,Is=new bs(js)!==js,Ts=cs.MISSED_STICKY,Ms=cs.UNSUPPORTED_Y,Ls=u&&(!Is||Ts||ps||ds||a(function(){return ks[ms]=!1,bs(js)!==js||bs(ks)===ks||\\"/a/i\\"!==String(bs(js,\\"i\\"))}));if(Ue(\\"RegExp\\",Ls)){for(var Us=function(t,e){var r,n,o,i,a,u,s=U(ws,this),c=es(t),f=void 0===e,l=[],h=t;if(!s&&c&&f&&t.constructor===Us)return t;if((c||U(ws,t))&&(t=t.source,f&&(e=os(h))),t=void 0===t?\\"\\":Wr(t),e=void 0===e?\\"\\":Wr(e),h=t,ps&&\\"dotAll\\"in js&&(n=!!e&&Rs(e,\\"s\\")>-1)&&(e=xs(e,/s/g,\\"\\")),r=e,Ts&&\\"sticky\\"in js&&(o=!!e&&Rs(e,\\"y\\")>-1)&&Ms&&(e=xs(e,/y/g,\\"\\")),ds&&(i=function(t){for(var e,r=t.length,n=0,o=\\"\\",i=[],a=Ve(null),u=!1,s=!1,c=0,f=\\"\\";n<=r;n++){if(\\"\\\\\\\\\\"===(e=Os(t,n)))e+=Os(t,++n);else if(\\"]\\"===e)u=!1;else if(!u)switch(!0){case\\"[\\"===e:u=!0;break;case\\"(\\"===e:if(o+=e,\\"?:\\"===Ps(t,n+1,n+3))continue;Es(As,Ps(t,n+1))&&(n+=2,s=!0),c++;continue;case\\">\\"===e&&s:if(\\"\\"===f||ut(a,f))throw new Ss(\\"Invalid capture group name\\");a[f]=!0,i[i.length]=[f,c],s=!1,f=\\"\\";continue}s?f+=e:o+=e}return[o,i]}(t),t=i[0],l=i[1]),a=Io(bs(t,e),s?this:ws,Us),(n||o||l.length)&&(u=ys(a),n&&(u.dotAll=!0,u.raw=Us(function(t){for(var e,r=t.length,n=0,o=\\"\\",i=!1;n<=r;n++)\\"\\\\\\\\\\"!==(e=Os(t,n))?i||\\".\\"!==e?(\\"[\\"===e?i=!0:\\"]\\"===e&&(i=!1),o+=e):o+=\\"[\\\\\\\\s\\\\\\\\S]\\":o+=e+Os(t,++n);return o}(t),r)),o&&(u.sticky=!0),l.length&&(u.groups=l)),t!==h)try{_t(a,\\"source\\",\\"\\"===h?\\"(?:)\\":h)}catch(t){}return a},Ns=gs(bs),Cs=0;Ns.length>Cs;)ls(Us,bs,Ns[Cs++]);ws.constructor=Us,Us.prototype=ws,ie(i,\\"RegExp\\",Us,{constructor:!0})}Uo(\\"RegExp\\");var _s=zt.PROPER,Fs=\\"toString\\",Bs=RegExp.prototype,Ds=Bs[Fs];(a(function(){return\\"/a/b\\"!==Ds.call({source:\\"a\\",flags:\\"b\\"})})||_s&&Ds.name!==Fs)&&ie(Bs,Fs,function(){var t=kt(this);return\\"/\\"+Wr(t.source)+\\"/\\"+Wr(os(t))},{unsafe:!0});var zs=ne.get,Ws=RegExp.prototype,qs=TypeError;u&&ps&&so(Ws,\\"dotAll\\",{configurable:!0,get:function(){if(this!==Ws){if(\\"RegExp\\"===E(this))return!!zs(this).dotAll;throw new qs(\\"Incompatible receiver, RegExp required\\")}}});var Hs=ne.get,$s=nt(\\"native-string-replace\\",String.prototype.replace),Ks=RegExp.prototype.exec,Gs=Ks,Vs=b(\\"\\".charAt),Ys=b(\\"\\".indexOf),Xs=b(\\"\\".replace),Js=b(\\"\\".slice),Qs=function(){var t=/a/,e=/b*/g;return f(Ks,t,\\"a\\"),f(Ks,e,\\"a\\"),0!==t.lastIndex||0!==e.lastIndex}(),Zs=cs.BROKEN_CARET,tc=void 0!==/()??/.exec(\\"\\")[1];(Qs||tc||Zs||ps||ds)&&(Gs=function(t){var e,r,n,o,i,a,u,s=this,c=Hs(s),l=Wr(t),h=c.raw;if(h)return h.lastIndex=s.lastIndex,e=f(Gs,h,l),s.lastIndex=h.lastIndex,e;var p=c.groups,v=Zs&&s.sticky,d=f(rs,s),g=s.source,y=0,m=l;if(v&&(d=Xs(d,\\"y\\",\\"\\"),-1===Ys(d,\\"g\\")&&(d+=\\"g\\"),m=Js(l,s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&\\"\\\\n\\"!==Vs(l,s.lastIndex-1))&&(g=\\"(?: \\"+g+\\")\\",m=\\" \\"+m,y++),r=new RegExp(\\"^(?:\\"+g+\\")\\",d)),tc&&(r=new RegExp(\\"^\\"+g+\\"$(?!\\\\\\\\s)\\",d)),Qs&&(n=s.lastIndex),o=f(Ks,v?r:s,m),v?o?(o.input=Js(o.input,y),o[0]=Js(o[0],y),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:Qs&&o&&(s.lastIndex=s.global?o.index+o[0].length:n),tc&&o&&o.length>1&&f($s,o[0],r,function(){for(i=1;i]*>)/g,Oc=/\\\\$([$&\'`]|\\\\d{1,2})/g,xc=function(t,e,r,n,o,i){var a=r+t.length,u=n.length,s=Oc;return void 0!==o&&(o=it(o),s=Ec),wc(i,s,function(i,s){var c;switch(bc(s,0)){case\\"$\\":return\\"$\\";case\\"&\\":return t;case\\"`\\":return Sc(e,0,r);case\\"\'\\":return Sc(e,a);case\\"<\\":c=o[Sc(s,1,-1)];break;default:var f=+s;if(0===f)return i;if(f>u){var l=mc(f/10);return 0===l?i:l<=u?void 0===n[l-1]?bc(s,1):n[l-1]+bc(s,1):i}c=n[f-1]}return void 0===c?\\"\\":c})},Rc=dt(\\"replace\\"),Pc=Math.max,Ac=Math.min,jc=b([].concat),kc=b([].push),Ic=b(\\"\\".indexOf),Tc=b(\\"\\".slice),Mc=\\"$0\\"===\\"a\\".replace(/./,\\"$0\\"),Lc=!!/./[Rc]&&\\"\\"===/./[Rc](\\"a\\",\\"$0\\"),Uc=!a(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:\\"7\\"},t},\\"7\\"!==\\"\\".replace(t,\\"$\\")});pc(\\"replace\\",function(t,e,r){var n=Lc?\\"$\\":\\"$0\\";return[function(t,r){var n=j(this),o=P(t)?void 0:Q(t,Rc);return o?f(o,t,n,r):f(e,Wr(n),t,r)},function(t,o){var i=kt(this),a=Wr(t);if(\\"string\\"==typeof o&&-1===Ic(o,n)&&-1===Ic(o,\\"$<\\")){var u=r(e,i,a,o);if(u.done)return u.value}var s=T(o);s||(o=Wr(o));var c,f=i.global;f&&(c=i.unicode,i.lastIndex=0);for(var l,h=[];null!==(l=yc(i,a))&&(kc(h,l),f);)\\"\\"===Wr(l[0])&&(i.lastIndex=dc(a,ve(i.lastIndex),c));for(var p,v=\\"\\",d=0,g=0;g=d&&(v+=Tc(a,d,b)+y,d=b+m.length)}return v+Tc(a,d)}]},!Uc||!Mc||Lc),pc(\\"search\\",function(t,e,r){return[function(e){var r=j(this),n=P(e)?void 0:Q(e,t);return n?f(n,e,r):new RegExp(e)[t](Wr(r))},function(t){var n=kt(this),o=Wr(t),i=r(e,n,o);if(i.done)return i.value;var a=n.lastIndex;wa(a,0)||(n.lastIndex=0);var u=yc(n,o);return wa(n.lastIndex,a)||(n.lastIndex=a),null===u?-1:u.index}]});var Nc=dt(\\"species\\"),Cc=function(t,e){var r,n=kt(t).constructor;return void 0===n||P(r=kt(n)[Nc])?e:La(r)},_c=cs.UNSUPPORTED_Y,Fc=Math.min,Bc=b([].push),Dc=b(\\"\\".slice),zc=!a(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r=\\"ab\\".split(t);return 2!==r.length||\\"a\\"!==r[0]||\\"b\\"!==r[1]}),Wc=\\"c\\"===\\"abbc\\".split(/(b)*/)[1]||4!==\\"test\\".split(/(?:)/,-1).length||2!==\\"ab\\".split(/(?:ab)*/).length||4!==\\".\\".split(/(.?)(.?)/).length||\\".\\".split(/()()/).length>1||\\"\\".split(/.?/).length;pc(\\"split\\",function(t,e,r){var n=\\"0\\".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:f(e,this,t,r)}:e;return[function(e,r){var o=j(this),i=P(e)?void 0:Q(e,t);return i?f(i,e,o,r):f(n,Wr(o),e,r)},function(t,o){var i=kt(this),a=Wr(t);if(!Wc){var u=r(n,i,a,o,n!==e);if(u.done)return u.value}var s=Cc(i,RegExp),c=i.unicode,f=new s(_c?\\"^(?:\\"+i.source+\\")\\":i,(i.ignoreCase?\\"i\\":\\"\\")+(i.multiline?\\"m\\":\\"\\")+(i.unicode?\\"u\\":\\"\\")+(_c?\\"g\\":\\"y\\")),l=void 0===o?4294967295:o>>>0;if(0===l)return[];if(0===a.length)return null===yc(f,a)?[a]:[];for(var h=0,p=0,v=[];p0;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r},Kc=b($c),Gc=b(\\"\\".slice),Vc=Math.ceil,Yc=function(t){return function(e,r,n){var o,i,a=Wr(j(e)),u=ve(r),s=a.length,c=void 0===n?\\" \\":Wr(n);return u<=s||\\"\\"===c?a:((i=Kc(c,Vc((o=u-s)/c.length))).length>o&&(i=Gc(i,0,o)),t?a+i:i+a)}},Xc={start:Yc(!1),end:Yc(!0)},Jc=Xc.start,Qc=Array,Zc=RegExp.escape,tf=b(\\"\\".charAt),ef=b(\\"\\".charCodeAt),rf=b(1.1.toString),nf=b([].join),of=/^[0-9a-z]/i,af=/^[$()*+./?[\\\\\\\\\\\\]^{|}]/,uf=RegExp(\\"^[!\\\\\\"#%&\',\\\\\\\\-:;<=>@`~\\"+Mi+\\"]\\"),sf=b(of.exec),cf={\\"\\\\t\\":\\"t\\",\\"\\\\n\\":\\"n\\",\\"\\\\v\\":\\"v\\",\\"\\\\f\\":\\"f\\",\\"\\\\r\\":\\"r\\"},ff=function(t){var e=rf(ef(t,0),16);return e.length<3?\\"\\\\\\\\x\\"+Jc(e,2,\\"0\\"):\\"\\\\\\\\u\\"+Jc(e,4,\\"0\\")},lf=!Zc||\\"\\\\\\\\x61b\\"!==Zc(\\"ab\\");Ce({target:\\"RegExp\\",stat:!0,forced:lf},{escape:function(t){!function(t){if(\\"string\\"==typeof t)return t;throw new qc(\\"Argument is not a string\\")}(t);for(var e=t.length,r=Qc(e),n=0;n=56320||n+1>=e||56320!=(64512&ef(t,n+1))?r[n]=ff(o):(r[n]=o,r[++n]=tf(t,n))}}return nf(r,\\"\\")}}),To(\\"Set\\",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Fo);var hf=Set.prototype,pf={Set:Set,add:b(hf.add),has:b(hf.has),remove:b(hf.delete),proto:hf},vf=pf.has,df=function(t){return vf(t),t},gf=pf.Set,yf=pf.proto,mf=b(yf.forEach),bf=b(yf.keys),wf=bf(new gf).next,Sf=function(t,e,r){return r?ci({iterator:bf(t),next:wf},e):mf(t,e)},Ef=pf.Set,Of=pf.add,xf=function(t){var e=new Ef;return Sf(t,function(t){Of(e,t)}),e},Rf=ln(pf.proto,\\"size\\",\\"get\\")||function(t){return t.size},Pf=\\"Invalid size\\",Af=RangeError,jf=TypeError,kf=Math.max,If=function(t,e){this.set=t,this.size=kf(e,0),this.has=J(t.has),this.keys=J(t.keys)};If.prototype={getIterator:function(){return{iterator:t=kt(f(this.keys,this.set)),next:t.next,done:!1};var t},includes:function(t){return f(this.has,this.set,t)}};var Tf=function(t){kt(t);var e=+t.size;if(e!=e)throw new jf(Pf);var r=ce(e);if(r<0)throw new Af(Pf);return new If(t,r)},Mf=pf.has,Lf=pf.remove,Uf=function(t){var e=df(this),r=Tf(t),n=xf(e);return Rf(e)<=r.size?Sf(e,function(t){r.includes(t)&&Lf(n,t)}):ci(r.getIterator(),function(t){Mf(e,t)&&Lf(n,t)}),n},Nf=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Cf=function(t){var e=L(\\"Set\\");try{(new e)[t](Nf(0));try{return(new e)[t](Nf(-1)),!1}catch(t){return!0}}catch(t){return!1}};Ce({target:\\"Set\\",proto:!0,real:!0,forced:!Cf(\\"difference\\")},{difference:Uf});var _f=pf.Set,Ff=pf.add,Bf=pf.has,Df=function(t){var e=df(this),r=Tf(t),n=new _f;return Rf(e)>r.size?ci(r.getIterator(),function(t){Bf(e,t)&&Ff(n,t)}):Sf(e,function(t){r.includes(t)&&Ff(n,t)}),n},zf=!Cf(\\"intersection\\")||a(function(){return\\"3,2\\"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))});Ce({target:\\"Set\\",proto:!0,real:!0,forced:zf},{intersection:Df});var Wf=pf.has,qf=function(t){var e=df(this),r=Tf(t);if(Rf(e)<=r.size)return!1!==Sf(e,function(t){if(r.includes(t))return!1},!0);var n=r.getIterator();return!1!==ci(n,function(t){if(Wf(e,t))return Tn(n,\\"normal\\",!1)})};Ce({target:\\"Set\\",proto:!0,real:!0,forced:!Cf(\\"isDisjointFrom\\")},{isDisjointFrom:qf});var Hf=function(t){var e=df(this),r=Tf(t);return!(Rf(e)>r.size)&&!1!==Sf(e,function(t){if(!r.includes(t))return!1},!0)};Ce({target:\\"Set\\",proto:!0,real:!0,forced:!Cf(\\"isSubsetOf\\")},{isSubsetOf:Hf});var $f=pf.has,Kf=function(t){var e=df(this),r=Tf(t);if(Rf(e)1?arguments[1]:void 0);return!1!==Sf(e,function(t){if(!r(t,t,e))return!1},!0)}});var el=dt(\\"iterator\\"),rl=Object,nl=L(\\"Set\\"),ol=function(t){return function(t){return M(t)&&\\"number\\"==typeof t.size&&T(t.has)&&T(t.keys)}(t)?t:function(t){if(P(t))return!1;var e=rl(t);return void 0!==e[el]||\\"@@iterator\\"in e||ut(un,pr(e))}(t)?new nl(t):t};Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{difference:function(t){return f(Uf,this,ol(t))}});var il=pf.Set,al=pf.add;Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{filter:function(t){var e=df(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=new il;return Sf(e,function(t){r(t,t,e)&&al(n,t)}),n}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{find:function(t){var e=df(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=Sf(e,function(t){if(r(t,t,e))return{value:t}},!0);return n&&n.value}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{intersection:function(t){return f(Df,this,ol(t))}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return f(qf,this,ol(t))}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return f(Hf,this,ol(t))}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return f(Kf,this,ol(t))}});var ul=b([].join),sl=b([].push);Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{join:function(t){var e=df(this),r=void 0===t?\\",\\":Wr(t),n=[];return Sf(e,function(t){sl(n,t)}),ul(n,r)}});var cl=pf.Set,fl=pf.add;Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{map:function(t){var e=df(this),r=ar(t,arguments.length>1?arguments[1]:void 0),n=new cl;return Sf(e,function(t){fl(n,r(t,t,e))}),n}});var ll=TypeError;Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=df(this),r=arguments.length<2,n=r?void 0:arguments[1];if(J(t),Sf(e,function(o){r?(r=!1,n=o):n=t(n,o,o,e)}),r)throw new ll(\\"Reduce of empty set with no initial value\\");return n}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{some:function(t){var e=df(this),r=ar(t,arguments.length>1?arguments[1]:void 0);return!0===Sf(e,function(t){if(r(t,t,e))return!0},!0)}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return f(Xf,this,ol(t))}}),Ce({target:\\"Set\\",proto:!0,real:!0,forced:!0},{union:function(t){return f(Qf,this,ol(t))}});var hl=dt(\\"species\\"),pl=dt(\\"isConcatSpreadable\\"),vl=W>=51||!a(function(){var t=[];return t[pl]=!1,t.concat()[0]!==t}),dl=function(t){if(!M(t))return!1;var e=t[pl];return void 0!==e?!!e:ur(t)},gl=!(vl&&(W>=51||!a(function(){var t=[];return(t.constructor={})[hl]=function(){return{foo:1}},1!==t.concat(Boolean).foo})));Ce({target:\\"Array\\",proto:!0,arity:1,forced:gl},{concat:function(t){var e,r,n,o,i,a=it(this),u=xr(a,0),s=0;for(e=-1,n=arguments.length;e1?arguments[1]:void 0,n=e.length,o=void 0===r?n:ip(ve(r),n),i=Wr(t);return op(e,o-i.length,o)===i}}),Ze(\\"String\\",\\"endsWith\\");var sp=RangeError,cp=String.fromCharCode,fp=String.fromCodePoint,lp=b([].join);Ce({target:\\"String\\",stat:!0,arity:1,forced:!!fp&&1!==fp.length},{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,o=0;n>o;){if(e=+arguments[o++],he(e,1114111)!==e)throw new sp(e+\\" is not a valid code point\\");r[o]=e<65536?cp(e):cp(55296+((e-=65536)>>10),e%1024+56320)}return lp(r,\\"\\")}});var hp=b(\\"\\".indexOf);Ce({target:\\"String\\",proto:!0,forced:!rp(\\"includes\\")},{includes:function(t){return!!~hp(Wr(j(this)),Wr(tp(t)),arguments.length>1?arguments[1]:void 0)}}),Ze(\\"String\\",\\"includes\\"),b(un.String);var pp=/Version\\\\/10(?:\\\\.\\\\d+){1,2}(?: [\\\\w./]+)?(?: Mobile\\\\/\\\\w+)? Safari\\\\//.test(_),vp=Xc.start;Ce({target:\\"String\\",proto:!0,forced:pp},{padStart:function(t){return vp(this,t,arguments.length>1?arguments[1]:void 0)}}),Ze(\\"String\\",\\"padStart\\");var dp=Xc.end;Ce({target:\\"String\\",proto:!0,forced:pp},{padEnd:function(t){return dp(this,t,arguments.length>1?arguments[1]:void 0)}}),Ze(\\"String\\",\\"padEnd\\");var gp=b([].push),yp=b([].join);Ce({target:\\"String\\",stat:!0},{raw:function(t){var e=k(it(t).raw),r=de(e);if(!r)return\\"\\";for(var n=arguments.length,o=[],i=0;;){if(gp(o,Wr(e[i++])),i===r)return yp(o,\\"\\");i1?arguments[1]:void 0,e.length)),n=Wr(t);return bp(e,r,r+n.length)===n}}),Ze(\\"String\\",\\"startsWith\\");var Op=zt.PROPER,xp=function(t){return a(function(){return!!Mi[t]()||\\"​…᠎\\"!==\\"​…᠎\\"[t]()||Op&&Mi[t].name!==t})},Rp=_i.start,Pp=xp(\\"trimStart\\")?function(){return Rp(this)}:\\"\\".trimStart;Ce({target:\\"String\\",proto:!0,name:\\"trimStart\\",forced:\\"\\".trimLeft!==Pp},{trimLeft:Pp}),Ce({target:\\"String\\",proto:!0,name:\\"trimStart\\",forced:\\"\\".trimStart!==Pp},{trimStart:Pp}),Ze(\\"String\\",\\"trimLeft\\");var Ap=_i.end,jp=xp(\\"trimEnd\\")?function(){return Ap(this)}:\\"\\".trimEnd;Ce({target:\\"String\\",proto:!0,name:\\"trimEnd\\",forced:\\"\\".trimRight!==jp},{trimRight:jp}),Ce({target:\\"String\\",proto:!0,name:\\"trimEnd\\",forced:\\"\\".trimEnd!==jp},{trimEnd:jp}),Ze(\\"String\\",\\"trimRight\\");var kp=Object.getOwnPropertyDescriptor,Ip=function(t){if(!u)return i[t];var e=kp(i,t);return e&&e.value},Tp=dt(\\"iterator\\"),Mp=!a(function(){var t=new URL(\\"b?a=1&b=2&c=3\\",\\"https://a\\"),e=t.searchParams,r=new URLSearchParams(\\"a=1&a=2&b=3\\"),n=\\"\\";return t.pathname=\\"c%20d\\",e.forEach(function(t,r){e.delete(\\"b\\"),n+=r+t}),r.delete(\\"a\\",2),r.delete(\\"b\\",void 0),!e.size&&!u||!e.sort||\\"https://a/c%20d?a=1&c=3\\"!==t.href||\\"3\\"!==e.get(\\"c\\")||\\"a=1\\"!==String(new URLSearchParams(\\"?a=1\\"))||!e[Tp]||\\"a\\"!==new URL(\\"https://a@b\\").username||\\"b\\"!==new URLSearchParams(new URLSearchParams(\\"a=b\\")).get(\\"a\\")||\\"xn--e1aybc\\"!==new URL(\\"https://тест\\").host||\\"#%D0%B1\\"!==new URL(\\"https://a#б\\").hash||\\"a1c3\\"!==n||\\"x\\"!==new URL(\\"https://x\\",void 0).host}),Lp=TypeError,Up=function(t,e){if(t0;)t[o]=t[--o];o!==i++&&(t[o]=n)}else for(var a=Np(r/2),u=Cp(vo(t,0,a),e),s=Cp(vo(t,a),e),c=u.length,f=s.length,l=0,h=0;l0&&0!=(t&r);r>>=1)e++;return e},pv=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return e>1114111?null:e},vv=function(t){for(var e=(t=nv(t,cv,\\" \\")).length,r=\\"\\",n=0;ne){r+=\\"%\\",n++;continue}var i=lv(t,n+1);if(i!=i){r+=o,n++;continue}n+=2;var a=hv(i);if(0===a)o=Jp(i);else{if(1===a||a>4){r+=\\"�\\",n++;continue}for(var u=[i],s=1;se||\\"%\\"!==tv(t,n));){var c=lv(t,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;rv(u,c),n+=2,s++}if(u.length!==a){r+=\\"�\\";continue}var f=pv(u);null===f?r+=\\"�\\":o=Qp(f)}}r+=o,n++}return r},dv=/[!\'()~]|%20/g,gv={\\"!\\":\\"%21\\",\\"\'\\":\\"%27\\",\\"(\\":\\"%28\\",\\")\\":\\"%29\\",\\"~\\":\\"%7E\\",\\"%20\\":\\"+\\"},yv=function(t){return gv[t]},mv=function(t){return nv(Xp(t),dv,yv)},bv=fn(function(t,e){zp(this,{type:Dp,target:Wp(t).entries,index:0,kind:e})},Bp,function(){var t=qp(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Pn(void 0,!0);var n=e[r];switch(t.kind){case\\"keys\\":return Pn(n.key,!1);case\\"values\\":return Pn(n.value,!1)}return Pn([n.key,n.value],!1)},!0),wv=function(t){this.entries=[],this.url=null,void 0!==t&&(M(t)?this.parseObject(t):this.parseQuery(\\"string\\"==typeof t?\\"?\\"===tv(t,0)?uv(t,1):t:Wr(t)))};wv.prototype={type:Bp,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,o,i,a,u,s=this.entries,c=Fn(t);if(c)for(r=(e=Dn(t,c)).next;!(n=f(r,e)).done;){if(o=Dn(kt(n.value)),(a=f(i=o.next,o)).done||(u=f(i,o)).done||!f(i,o).done)throw new Yp(\\"Expected sequence with length 2\\");rv(s,{key:Wr(a.value),value:Wr(u.value)})}else for(var l in t)ut(t,l)&&rv(s,{key:l,value:Wr(t[l])})},parseQuery:function(t){if(t)for(var e,r,n=this.entries,o=av(t,\\"&\\"),i=0;i0?arguments[0]:void 0));u||(this.size=t.entries.length)},Ev=Sv.prototype;if(Mo(Ev,{append:function(t,e){var r=Wp(this);Up(arguments.length,2),rv(r.entries,{key:Wr(t),value:Wr(e)}),u||this.length++,r.updateURL()},delete:function(t){for(var e=Wp(this),r=Up(arguments.length,1),n=e.entries,o=Wr(t),i=r<2?void 0:arguments[1],a=void 0===i?i:Wr(i),s=0;se.key?1:-1}),t.updateURL()},forEach:function(t){for(var e,r=Wp(this).entries,n=ar(t,arguments.length>1?arguments[1]:void 0),o=0;o1?Rv(arguments[1]):{})}}),T($p)){var Pv=function(t){return ko(this,Gp),new $p(t,arguments.length>1?Rv(arguments[1]):{})};Gp.constructor=Pv,Pv.prototype=Gp,Ce({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Pv})}}var Av={URLSearchParams:Sv,getState:Wp},jv=URLSearchParams,kv=jv.prototype,Iv=b(kv.append),Tv=b(kv.delete),Mv=b(kv.forEach),Lv=b([].push),Uv=new jv(\\"a=1&a=2&b=3\\");Uv.delete(\\"a\\",1),Uv.delete(\\"b\\",void 0),Uv+\\"\\"!=\\"a=2\\"&&ie(kv,\\"delete\\",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return Tv(this,t);var n=[];Mv(this,function(t,e){Lv(n,{key:e,value:t})}),Up(e,1);for(var o,i=Wr(t),a=Wr(r),u=0,s=0,c=!1,f=n.length;uo;)for(var s,c=R(arguments[o++]),l=i?$v(_e(c),i(c)):_e(c),h=l.length,p=0;h>p;)s=l[p++],u&&!f(a,c,s)||(r[s]=c[s]);return r}:qv,Gv=2147483647,Vv=/[^\\\\0-\\\\u007E]/,Yv=/[.\\\\u3002\\\\uFF0E\\\\uFF61]/g,Xv=\\"Overflow: input needs wider integers to process\\",Jv=RangeError,Qv=b(Yv.exec),Zv=Math.floor,td=String.fromCharCode,ed=b(\\"\\".charCodeAt),rd=b([].join),nd=b([].push),od=b(\\"\\".replace),id=b(\\"\\".split),ad=b(\\"\\".toLowerCase),ud=function(t){return t+22+75*(t<26)},sd=function(t,e,r){var n=0;for(t=r?Zv(t/700):t>>1,t+=Zv(t/e);t>455;)t=Zv(t/35),n+=36;return Zv(n+36*t/(t+38))},cd=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r=55296&&o<=56319&&r=i&&nZv((Gv-a)/l))throw new Jv(Xv);for(a+=(f-i)*l,i=f,r=0;rGv)throw new Jv(Xv);if(n===i){for(var h=a,p=36;;){var v=p<=u?1:p>=u+26?26:p-u;if(h?@[\\\\\\\\\\\\]^|]/,qd=/[\\\\0\\\\t\\\\n\\\\r #/:<>?@[\\\\\\\\\\\\]^|]/,Hd=/^[\\\\u0000-\\\\u0020]+/,$d=/(^|[^\\\\u0000-\\\\u0020])[\\\\u0000-\\\\u0020]+$/,Kd=/[\\\\t\\\\n\\\\r]/g,Gd=function(t){var e,r,n,o;if(\\"number\\"==typeof t){for(e=[],r=0;r<4;r++)Td(e,t%256),t=md(t/256);return Ed(e,\\".\\")}if(\\"object\\"==typeof t){for(e=\\"\\",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?\\":\\":\\"::\\",o=!0):(e+=Od(t[r],16),r<7&&(e+=\\":\\")));return\\"[\\"+e+\\"]\\"}return t},Vd={},Yd=Kv({},Vd,{\\" \\":1,\'\\"\':1,\\"<\\":1,\\">\\":1,\\"`\\":1}),Xd=Kv({},Yd,{\\"#\\":1,\\"?\\":1,\\"{\\":1,\\"}\\":1}),Jd=Kv({},Xd,{\\"/\\":1,\\":\\":1,\\";\\":1,\\"=\\":1,\\"@\\":1,\\"[\\":1,\\"\\\\\\\\\\":1,\\"]\\":1,\\"^\\":1,\\"|\\":1}),Qd=function(t,e){var r=fd(t,0);return r>32&&r<127&&!ut(e,t)?t:encodeURIComponent(t)},Zd={ftp:21,file:null,http:80,https:443,ws:80,wss:443},tg=function(t,e){var r;return 2===t.length&&Sd(Nd,wd(t,0))&&(\\":\\"===(r=wd(t,1))||!e&&\\"|\\"===r)},eg=function(t){var e;return t.length>1&&tg(kd(t,0,2))&&(2===t.length||\\"/\\"===(e=wd(t,2))||\\"\\\\\\\\\\"===e||\\"?\\"===e||\\"#\\"===e)},rg=function(t){return\\".\\"===t||\\"%2e\\"===Id(t)},ng={},og={},ig={},ag={},ug={},sg={},cg={},fg={},lg={},hg={},pg={},vg={},dg={},gg={},yg={},mg={},bg={},wg={},Sg={},Eg={},Og={},xg=function(t,e,r){var n,o,i,a=Wr(t);if(e){if(o=this.parse(a))throw new gd(o);this.searchParams=null}else{if(void 0!==r&&(n=new xg(r,!0)),o=this.parse(a,null,n))throw new gd(o);(i=vd(new pd)).bindURL(this),this.searchParams=i}};xg.prototype={type:\\"URL\\",parse:function(t,e,r){var n,o,i,a,u,s=this,c=e||ng,f=0,l=\\"\\",h=!1,p=!1,v=!1;for(t=Wr(t),e||(s.scheme=\\"\\",s.username=\\"\\",s.password=\\"\\",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,t=Pd(t,Hd,\\"\\"),t=Pd(t,$d,\\"$1\\")),t=Pd(t,Kd,\\"\\"),n=Wn(t);f<=n.length;){switch(o=n[f],c){case ng:if(!o||!Sd(Nd,o)){if(e)return Md;c=ig;continue}l+=Id(o),c=og;break;case og:if(o&&(Sd(Cd,o)||\\"+\\"===o||\\"-\\"===o||\\".\\"===o))l+=Id(o);else{if(\\":\\"!==o){if(e)return Md;l=\\"\\",c=ig,f=0;continue}if(e&&(s.isSpecial()!==ut(Zd,l)||\\"file\\"===l&&(s.includesCredentials()||null!==s.port)||\\"file\\"===s.scheme&&!s.host))return;if(s.scheme=l,e)return void(s.isSpecial()&&Zd[s.scheme]===s.port&&(s.port=null));l=\\"\\",\\"file\\"===s.scheme?c=gg:s.isSpecial()&&r&&r.scheme===s.scheme?c=ag:s.isSpecial()?c=fg:\\"/\\"===n[f+1]?(c=ug,f++):(s.cannotBeABaseURL=!0,Rd(s.path,\\"\\"),c=Sg)}break;case ig:if(!r||r.cannotBeABaseURL&&\\"#\\"!==o)return Md;if(r.cannotBeABaseURL&&\\"#\\"===o){s.scheme=r.scheme,s.path=vo(r.path),s.query=r.query,s.fragment=\\"\\",s.cannotBeABaseURL=!0,c=Og;break}c=\\"file\\"===r.scheme?gg:sg;continue;case ag:if(\\"/\\"!==o||\\"/\\"!==n[f+1]){c=sg;continue}c=lg,f++;break;case ug:if(\\"/\\"===o){c=hg;break}c=wg;continue;case sg:if(s.scheme=r.scheme,o===Wv)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=vo(r.path),s.query=r.query;else if(\\"/\\"===o||\\"\\\\\\\\\\"===o&&s.isSpecial())c=cg;else if(\\"?\\"===o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=vo(r.path),s.query=\\"\\",c=Eg;else{if(\\"#\\"!==o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=vo(r.path),s.path.length--,c=wg;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=vo(r.path),s.query=r.query,s.fragment=\\"\\",c=Og}break;case cg:if(!s.isSpecial()||\\"/\\"!==o&&\\"\\\\\\\\\\"!==o){if(\\"/\\"!==o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,c=wg;continue}c=hg}else c=lg;break;case fg:if(c=lg,\\"/\\"!==o||\\"/\\"!==wd(l,f+1))continue;f++;break;case lg:if(\\"/\\"!==o&&\\"\\\\\\\\\\"!==o){c=hg;continue}break;case hg:if(\\"@\\"===o){h&&(l=\\"%40\\"+l),h=!0,i=Wn(l);for(var d=0;d65535)return Ud;s.port=s.isSpecial()&&m===Zd[s.scheme]?null:m,l=\\"\\"}if(e)return;c=bg;continue}return Ud}l+=o;break;case gg:if(s.scheme=\\"file\\",\\"/\\"===o||\\"\\\\\\\\\\"===o)c=yg;else{if(!r||\\"file\\"!==r.scheme){c=wg;continue}switch(o){case Wv:s.host=r.host,s.path=vo(r.path),s.query=r.query;break;case\\"?\\":s.host=r.host,s.path=vo(r.path),s.query=\\"\\",c=Eg;break;case\\"#\\":s.host=r.host,s.path=vo(r.path),s.query=r.query,s.fragment=\\"\\",c=Og;break;default:eg(Ed(vo(n,f),\\"\\"))||(s.host=r.host,s.path=vo(r.path),s.shortenPath()),c=wg;continue}}break;case yg:if(\\"/\\"===o||\\"\\\\\\\\\\"===o){c=mg;break}r&&\\"file\\"===r.scheme&&!eg(Ed(vo(n,f),\\"\\"))&&(tg(r.path[0],!0)?Rd(s.path,r.path[0]):s.host=r.host),c=wg;continue;case mg:if(o===Wv||\\"/\\"===o||\\"\\\\\\\\\\"===o||\\"?\\"===o||\\"#\\"===o){if(!e&&tg(l))c=wg;else if(\\"\\"===l){if(s.host=\\"\\",e)return;c=bg}else{if(a=s.parseHost(l))return a;if(\\"localhost\\"===s.host&&(s.host=\\"\\"),e)return;l=\\"\\",c=bg}continue}l+=o;break;case bg:if(s.isSpecial()){if(c=wg,\\"/\\"!==o&&\\"\\\\\\\\\\"!==o)continue}else if(e||\\"?\\"!==o)if(e||\\"#\\"!==o){if(o!==Wv&&(c=wg,\\"/\\"!==o))continue}else s.fragment=\\"\\",c=Og;else s.query=\\"\\",c=Eg;break;case wg:if(o===Wv||\\"/\\"===o||\\"\\\\\\\\\\"===o&&s.isSpecial()||!e&&(\\"?\\"===o||\\"#\\"===o)){if(\\"..\\"===(u=Id(u=l))||\\"%2e.\\"===u||\\".%2e\\"===u||\\"%2e%2e\\"===u?(s.shortenPath(),\\"/\\"===o||\\"\\\\\\\\\\"===o&&s.isSpecial()||Rd(s.path,\\"\\")):rg(l)?\\"/\\"===o||\\"\\\\\\\\\\"===o&&s.isSpecial()||Rd(s.path,\\"\\"):(\\"file\\"===s.scheme&&!s.path.length&&tg(l)&&(s.host&&(s.host=\\"\\"),l=wd(l,0)+\\":\\"),Rd(s.path,l)),l=\\"\\",\\"file\\"===s.scheme&&(o===Wv||\\"?\\"===o||\\"#\\"===o))for(;s.path.length>1&&\\"\\"===s.path[0];)Ad(s.path);\\"?\\"===o?(s.query=\\"\\",c=Eg):\\"#\\"===o&&(s.fragment=\\"\\",c=Og)}else l+=Qd(o,Xd);break;case Sg:\\"?\\"===o?(s.query=\\"\\",c=Eg):\\"#\\"===o?(s.fragment=\\"\\",c=Og):o!==Wv&&(s.path[0]+=Qd(o,Vd));break;case Eg:e||\\"#\\"!==o?o!==Wv&&(\\"\'\\"===o&&s.isSpecial()?s.query+=\\"%27\\":s.query+=\\"#\\"===o?\\"%23\\":Qd(o,Vd)):(s.fragment=\\"\\",c=Og);break;case Og:o!==Wv&&(s.fragment+=Qd(o,Yd))}f++}},parseHost:function(t){var e,r,n;if(\\"[\\"===wd(t,0)){if(\\"]\\"!==wd(t,t.length-1))return Ld;if(e=function(t){var e,r,n,o,i,a,u,s=[0,0,0,0,0,0,0,0],c=0,f=null,l=0,h=function(){return wd(t,l)};if(\\":\\"===h()){if(\\":\\"!==wd(t,1))return;l+=2,f=++c}for(;h();){if(8===c)return;if(\\":\\"!==h()){for(e=r=0;r<4&&Sd(zd,h());)e=16*e+yd(h(),16),l++,r++;if(\\".\\"===h()){if(0===r)return;if(l-=r,c>6)return;for(n=0;h();){if(o=null,n>0){if(!(\\".\\"===h()&&n<4))return;l++}if(!Sd(_d,h()))return;for(;Sd(_d,h());){if(i=yd(h(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;l++}s[c]=256*s[c]+o,2!=++n&&4!==n||c++}if(4!==n)return;break}if(\\":\\"===h()){if(l++,!h())return}else if(h())return;s[c++]=e}else{if(null!==f)return;l++,f=++c}}if(null!==f)for(a=c-f,c=7;0!==c&&a>0;)u=s[c],s[c--]=s[f+a-1],s[f+--a]=u;else if(8!==c)return;return s}(kd(t,1,-1)),!e)return Ld;this.host=e}else if(this.isSpecial()){if(t=function(t){var e,r,n=[],o=id(od(ad(t),Yv,\\".\\"),\\".\\");for(e=0;e4)return t;for(r=[],n=0;n1&&\\"0\\"===wd(o,0)&&(i=Sd(Fd,o)?16:8,o=kd(o,8===i?1:2)),\\"\\"===o)a=0;else{if(!Sd(10===i?Dd:8===i?Bd:zd,o))return t;a=yd(o,i)}Rd(r,a)}for(n=0;n=bd(256,5-e))return null}else if(a>255)return null;for(u=xd(r),n=0;n1?arguments[1]:void 0,n=ld(e,new xg(t,!1,r));u||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Pg=Rg.prototype,Ag=function(t,e){return{get:function(){return hd(this)[t]()},set:e&&function(t){return hd(this)[e](t)},configurable:!0,enumerable:!0}};if(u&&(so(Pg,\\"href\\",Ag(\\"serialize\\",\\"setHref\\")),so(Pg,\\"origin\\",Ag(\\"getOrigin\\")),so(Pg,\\"protocol\\",Ag(\\"getProtocol\\",\\"setProtocol\\")),so(Pg,\\"username\\",Ag(\\"getUsername\\",\\"setUsername\\")),so(Pg,\\"password\\",Ag(\\"getPassword\\",\\"setPassword\\")),so(Pg,\\"host\\",Ag(\\"getHost\\",\\"setHost\\")),so(Pg,\\"hostname\\",Ag(\\"getHostname\\",\\"setHostname\\")),so(Pg,\\"port\\",Ag(\\"getPort\\",\\"setPort\\")),so(Pg,\\"pathname\\",Ag(\\"getPathname\\",\\"setPathname\\")),so(Pg,\\"search\\",Ag(\\"getSearch\\",\\"setSearch\\")),so(Pg,\\"searchParams\\",Ag(\\"getSearchParams\\")),so(Pg,\\"hash\\",Ag(\\"getHash\\",\\"setHash\\"))),ie(Pg,\\"toJSON\\",function(){return hd(this).serialize()},{enumerable:!0}),ie(Pg,\\"toString\\",function(){return hd(this).serialize()},{enumerable:!0}),dd){var jg=dd.createObjectURL,kg=dd.revokeObjectURL;jg&&ie(Rg,\\"createObjectURL\\",ar(jg,dd)),kg&&ie(Rg,\\"revokeObjectURL\\",ar(kg,dd))}an(Rg,\\"URL\\"),Ce({global:!0,constructor:!0,forced:!Mp,sham:!u},{URL:Rg});var Ig=L(\\"URL\\"),Tg=Mp&&a(function(){Ig.canParse()}),Mg=a(function(){return 1!==Ig.canParse.length});Ce({target:\\"URL\\",stat:!0,forced:!Tg||Mg},{canParse:function(t){var e=Up(arguments.length,1),r=Wr(t),n=e<2||void 0===arguments[1]?void 0:Wr(arguments[1]);try{return!!new Ig(r,n)}catch(t){return!1}}});var Lg=L(\\"URL\\");Ce({target:\\"URL\\",stat:!0,forced:!Mp},{parse:function(t){var e=Up(arguments.length,1),r=Wr(t),n=e<2||void 0===arguments[1]?void 0:Wr(arguments[1]);try{return new Lg(r,n)}catch(t){return null}}}),Ce({target:\\"URL\\",proto:!0,enumerable:!0},{toJSON:function(){return f(URL.prototype.toString,this)}});var Ug=WeakMap.prototype,Ng={WeakMap:WeakMap,set:b(Ug.set),get:b(Ug.get),has:b(Ug.has),remove:b(Ug.delete)},Cg=Ng.has,_g=function(t){return Cg(t),t},Fg=Ng.get,Bg=Ng.has,Dg=Ng.set;Ce({target:\\"WeakMap\\",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,n,o=_g(this);return Bg(o,t)?(r=Fg(o,t),\\"update\\"in e&&(r=e.update(r,t,o),Dg(o,t,r)),r):(n=e.insert(t,o),Dg(o,t,n),n)}}),Ce({target:\\"WeakMap\\",stat:!0,forced:!0},{from:ei(Ng.WeakMap,Ng.set,!0)}),Ce({target:\\"WeakMap\\",stat:!0,forced:!0},{of:ri(Ng.WeakMap,Ng.set,!0)});var zg=Ng.remove;Ce({target:\\"WeakMap\\",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=_g(this),r=!0,n=0,o=arguments.length;n2&&(n=r,M(o=arguments[2])&&\\"cause\\"in o&&_t(n,\\"cause\\",o.cause));var s=[];return Ao(t,ny,{that:s}),_t(r,\\"errors\\",s),r};dn?dn(oy,ry):Ae(oy,ry,{name:!0});var iy=oy.prototype=Ve(ry.prototype,{constructor:d(1,oy),message:d(1,\\"\\"),name:d(1,\\"AggregateError\\")});Ce({global:!0,constructor:!0,arity:2},{AggregateError:oy});var ay,uy,sy,cy,fy=function(t){return _.slice(0,t.length)===t},ly=fy(\\"Bun/\\")?\\"BUN\\":fy(\\"Cloudflare-Workers\\")?\\"CLOUDFLARE\\":fy(\\"Deno/\\")?\\"DENO\\":fy(\\"Node.js/\\")?\\"NODE\\":i.Bun&&\\"string\\"==typeof Bun.version?\\"BUN\\":i.Deno&&\\"object\\"==typeof Deno.version?\\"DENO\\":\\"process\\"===E(i.process)?\\"NODE\\":i.window&&i.document?\\"BROWSER\\":\\"REST\\",hy=\\"NODE\\"===ly,py=/(?:ipad|iphone|ipod).*applewebkit/i.test(_),vy=i.setImmediate,dy=i.clearImmediate,gy=i.process,yy=i.Dispatch,my=i.Function,by=i.MessageChannel,wy=i.String,Sy=0,Ey={},Oy=\\"onreadystatechange\\";a(function(){ay=i.location});var xy=function(t){if(ut(Ey,t)){var e=Ey[t];delete Ey[t],e()}},Ry=function(t){return function(){xy(t)}},Py=function(t){xy(t.data)},Ay=function(t){i.postMessage(wy(t),ay.protocol+\\"//\\"+ay.host)};vy&&dy||(vy=function(t){Up(arguments.length,1);var e=T(t)?t:my(t),r=vo(arguments,1);return Ey[++Sy]=function(){Ra(e,void 0,r)},uy(Sy),Sy},dy=function(t){delete Ey[t]},hy?uy=function(t){gy.nextTick(Ry(t))}:yy&&yy.now?uy=function(t){yy.now(Ry(t))}:by&&!py?(cy=(sy=new by).port2,sy.port1.onmessage=Py,uy=ar(cy.postMessage,cy)):i.addEventListener&&T(i.postMessage)&&!i.importScripts&&ay&&\\"file:\\"!==ay.protocol&&!a(Ay)?(uy=Ay,i.addEventListener(\\"message\\",Py,!1)):uy=Oy in Et(\\"script\\")?function(t){De.appendChild(Et(\\"script\\"))[Oy]=function(){De.removeChild(this),xy(t)}}:function(t){setTimeout(Ry(t),0)});var jy={set:vy,clear:dy},ky=function(){this.head=null,this.tail=null};ky.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var Iy,Ty,My,Ly,Uy,Ny=ky,Cy=/ipad|iphone|ipod/i.test(_)&&\\"undefined\\"!=typeof Pebble,_y=/web0s(?!.*chrome)/i.test(_),Fy=jy.set,By=i.MutationObserver||i.WebKitMutationObserver,Dy=i.document,zy=i.process,Wy=i.Promise,qy=Ip(\\"queueMicrotask\\");if(!qy){var Hy=new Ny,$y=function(){var t,e;for(hy&&(t=zy.domain)&&t.exit();e=Hy.get();)try{e()}catch(t){throw Hy.head&&Iy(),t}t&&t.enter()};py||hy||_y||!By||!Dy?!Cy&&Wy&&Wy.resolve?((Ly=Wy.resolve(void 0)).constructor=Wy,Uy=ar(Ly.then,Ly),Iy=function(){Uy($y)}):hy?Iy=function(){zy.nextTick($y)}:(Fy=ar(Fy,i),Iy=function(){Fy($y)}):(Ty=!0,My=Dy.createTextNode(\\"\\"),new By($y).observe(My,{characterData:!0}),Iy=function(){My.data=Ty=!Ty}),qy=function(t){Hy.head||Iy(),Hy.add(t)}}var Ky,Gy,Vy,Yy=qy,Xy=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Jy=i.Promise,Qy=dt(\\"species\\"),Zy=!1,tm=T(i.PromiseRejectionEvent),em=Ue(\\"Promise\\",function(){var t=Kt(Jy),e=t!==String(Jy);if(!e&&66===W)return!0;if(!W||W<51||!/native code/.test(t)){var r=new Jy(function(t){t(1)}),n=function(t){t(function(){},function(){})};if((r.constructor={})[Qy]=n,!(Zy=r.then(function(){})instanceof n))return!0}return!(e||\\"BROWSER\\"!==ly&&\\"DENO\\"!==ly||tm)}),rm={CONSTRUCTOR:em,REJECTION_EVENT:tm,SUBCLASSING:Zy},nm=TypeError,om=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw new nm(\\"Bad Promise constructor\\");e=t,r=n}),this.resolve=J(e),this.reject=J(r)},im={f:function(t){return new om(t)}},am=jy.set,um=\\"Promise\\",sm=rm.CONSTRUCTOR,cm=rm.REJECTION_EVENT,fm=rm.SUBCLASSING,lm=ne.getterFor(um),hm=ne.set,pm=Jy&&Jy.prototype,vm=Jy,dm=pm,gm=i.TypeError,ym=i.document,mm=i.process,bm=im.f,wm=bm,Sm=!!(ym&&ym.createEvent&&i.dispatchEvent),Em=\\"unhandledrejection\\",Om=function(t){var e;return!(!M(t)||!T(e=t.then))&&e},xm=function(t,e){var r,n,o,i=e.value,a=1===e.state,u=a?t.ok:t.fail,s=t.resolve,c=t.reject,l=t.domain;try{u?(a||(2===e.rejection&&km(e),e.rejection=1),!0===u?r=i:(l&&l.enter(),r=u(i),l&&(l.exit(),o=!0)),r===t.promise?c(new gm(\\"Promise-chain cycle\\")):(n=Om(r))?f(n,r,s,c):s(r)):c(i)}catch(t){l&&!o&&l.exit(),c(t)}},Rm=function(t,e){t.notified||(t.notified=!0,Yy(function(){for(var r,n=t.reactions;r=n.get();)xm(r,t);t.notified=!1,e&&!t.rejection&&Am(t)}))},Pm=function(t,e,r){var n,o;Sm?((n=ym.createEvent(\\"Event\\")).promise=e,n.reason=r,n.initEvent(t,!1,!0),i.dispatchEvent(n)):n={promise:e,reason:r},!cm&&(o=i[\\"on\\"+t])?o(n):t===Em&&function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}(\\"Unhandled promise rejection\\",r)},Am=function(t){f(am,i,function(){var e,r=t.facade,n=t.value;if(jm(t)&&(e=Xy(function(){hy?mm.emit(\\"unhandledRejection\\",n,r):Pm(Em,r,n)}),t.rejection=hy||jm(t)?2:1,e.error))throw e.value})},jm=function(t){return 1!==t.rejection&&!t.parent},km=function(t){f(am,i,function(){var e=t.facade;hy?mm.emit(\\"rejectionHandled\\",e):Pm(\\"rejectionhandled\\",e,t.value)})},Im=function(t,e,r){return function(n){t(e,n,r)}},Tm=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Rm(t,!0))},Mm=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new gm(\\"Promise can\'t be resolved itself\\");var n=Om(e);n?Yy(function(){var r={done:!1};try{f(n,e,Im(Mm,r,t),Im(Tm,r,t))}catch(e){Tm(r,e,t)}}):(t.value=e,t.state=1,Rm(t,!1))}catch(e){Tm({done:!1},e,t)}}};if(sm&&(vm=function(t){ko(this,dm),J(t),f(Ky,this);var e=lm(this);try{t(Im(Mm,e),Im(Tm,e))}catch(t){Tm(e,t)}},(Ky=function(t){hm(this,{type:um,done:!1,notified:!1,parent:!1,reactions:new Ny,rejection:!1,state:0,value:null})}).prototype=ie(dm=vm.prototype,\\"then\\",function(t,e){var r=lm(this),n=bm(Cc(this,vm));return r.parent=!0,n.ok=!T(t)||t,n.fail=T(e)&&e,n.domain=hy?mm.domain:void 0,0===r.state?r.reactions.add(n):Yy(function(){xm(n,r)}),n.promise}),Gy=function(){var t=new Ky,e=lm(t);this.promise=t,this.resolve=Im(Mm,e),this.reject=Im(Tm,e)},im.f=bm=function(t){return t===vm||void 0===t?new Gy(t):wm(t)},T(Jy)&&pm!==Object.prototype)){Vy=pm.then,fm||ie(pm,\\"then\\",function(t,e){var r=this;return new vm(function(t,e){f(Vy,r,t,e)}).then(t,e)},{unsafe:!0});try{delete pm.constructor}catch(t){}dn&&dn(pm,dm)}Ce({global:!0,constructor:!0,wrap:!0,forced:sm},{Promise:vm}),an(vm,um,!1),Uo(um);var Lm=rm.CONSTRUCTOR||!Gn(function(t){Jy.all(t).then(void 0,function(){})});Ce({target:\\"Promise\\",stat:!0,forced:Lm},{all:function(t){var e=this,r=im.f(e),n=r.resolve,o=r.reject,i=Xy(function(){var r=J(e.resolve),i=[],a=0,u=1;Ao(t,function(t){var s=a++,c=!1;u++,f(r,e,t).then(function(t){c||(c=!0,i[s]=t,--u||n(i))},o)}),--u||n(i)});return i.error&&o(i.value),r.promise}});var Um=Jy&&Jy.prototype;if(Ce({target:\\"Promise\\",proto:!0,forced:rm.CONSTRUCTOR,real:!0},{catch:function(t){return this.then(void 0,t)}}),T(Jy)){var Nm=L(\\"Promise\\").prototype.catch;Um.catch!==Nm&&ie(Um,\\"catch\\",Nm,{unsafe:!0})}Ce({target:\\"Promise\\",stat:!0,forced:Lm},{race:function(t){var e=this,r=im.f(e),n=r.reject,o=Xy(function(){var o=J(e.resolve);Ao(t,function(t){f(o,e,t).then(r.resolve,n)})});return o.error&&n(o.value),r.promise}}),Ce({target:\\"Promise\\",stat:!0,forced:rm.CONSTRUCTOR},{reject:function(t){var e=im.f(this);return(0,e.reject)(t),e.promise}});var Cm=function(t,e){if(kt(t),M(e)&&e.constructor===t)return e;var r=im.f(t);return(0,r.resolve)(e),r.promise};Ce({target:\\"Promise\\",stat:!0,forced:rm.CONSTRUCTOR},{resolve:function(t){return Cm(this,t)}}),Ce({target:\\"Promise\\",stat:!0,forced:Lm},{allSettled:function(t){var e=this,r=im.f(e),n=r.resolve,o=r.reject,i=Xy(function(){var r=J(e.resolve),o=[],i=0,a=1;Ao(t,function(t){var u=i++,s=!1;a++,f(r,e,t).then(function(t){s||(s=!0,o[u]={status:\\"fulfilled\\",value:t},--a||n(o))},function(t){s||(s=!0,o[u]={status:\\"rejected\\",reason:t},--a||n(o))})}),--a||n(o)});return i.error&&o(i.value),r.promise}});var _m=\\"No one promise resolved\\";Ce({target:\\"Promise\\",stat:!0,forced:Lm},{any:function(t){var e=this,r=L(\\"AggregateError\\"),n=im.f(e),o=n.resolve,i=n.reject,a=Xy(function(){var n=J(e.resolve),a=[],u=0,s=1,c=!1;Ao(t,function(t){var l=u++,h=!1;s++,f(n,e,t).then(function(t){h||c||(c=!0,o(t))},function(t){h||c||(h=!0,a[l]=t,--s||i(new r(a,_m)))})}),--s||i(new r(a,_m))});return a.error&&i(a.value),n.promise}}),Ce({target:\\"Promise\\",stat:!0},{withResolvers:function(){var t=im.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var Fm=Jy&&Jy.prototype,Bm=!!Jy&&a(function(){Fm.finally.call({then:function(){}},function(){})});if(Ce({target:\\"Promise\\",proto:!0,real:!0,forced:Bm},{finally:function(t){var e=Cc(this,L(\\"Promise\\")),r=T(t);return this.then(r?function(r){return Cm(e,t()).then(function(){return r})}:t,r?function(r){return Cm(e,t()).then(function(){throw r})}:t)}}),T(Jy)){var Dm=L(\\"Promise\\").prototype.finally;Fm.finally!==Dm&&ie(Fm,\\"finally\\",Dm,{unsafe:!0})}var zm=i.Promise,Wm=!1,qm=!zm||!zm.try||Xy(function(){zm.try(function(t){Wm=8===t},8)}).error||!Wm;Ce({target:\\"Promise\\",stat:!0,forced:qm},{try:function(t){var e=arguments.length>1?vo(arguments,1):[],r=im.f(this),n=Xy(function(){return Ra(J(t),void 0,e)});return(n.error?r.reject:r.resolve)(n.value),r.promise}}),Ze(\\"Promise\\",\\"finally\\");var Hm=\\"URLSearchParams\\"in self,$m=\\"Symbol\\"in self&&\\"iterator\\"in Symbol,Km=\\"FileReader\\"in self&&\\"Blob\\"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),Gm=\\"FormData\\"in self,Vm=\\"ArrayBuffer\\"in self;if(Vm)var Ym=[\\"[object Int8Array]\\",\\"[object Uint8Array]\\",\\"[object Uint8ClampedArray]\\",\\"[object Int16Array]\\",\\"[object Uint16Array]\\",\\"[object Int32Array]\\",\\"[object Uint32Array]\\",\\"[object Float32Array]\\",\\"[object Float64Array]\\"],Xm=ArrayBuffer.isView||function(t){return t&&Ym.indexOf(Object.prototype.toString.call(t))>-1};function Jm(t){if(\\"string\\"!=typeof t&&(t=String(t)),/[^a-z0-9\\\\-#$%&\'*+.^_`|~]/i.test(t))throw new TypeError(\\"Invalid character in header field name\\");return t.toLowerCase()}function Qm(t){return\\"string\\"!=typeof t&&(t=String(t)),t}function Zm(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return $m&&(e[Symbol.iterator]=function(){return e}),e}function tb(t){this.map={},t instanceof tb?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function eb(t){if(t.bodyUsed)return Promise.reject(new TypeError(\\"Already read\\"));t.bodyUsed=!0}function rb(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function nb(t){var e=new FileReader,r=rb(e);return e.readAsArrayBuffer(t),r}function ob(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function ib(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?\\"string\\"==typeof t?this._bodyText=t:Km&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Gm&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Hm&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Vm&&Km&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=ob(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Vm&&(ArrayBuffer.prototype.isPrototypeOf(t)||Xm(t))?this._bodyArrayBuffer=ob(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText=\\"\\",this.headers.get(\\"content-type\\")||(\\"string\\"==typeof t?this.headers.set(\\"content-type\\",\\"text/plain;charset=UTF-8\\"):this._bodyBlob&&this._bodyBlob.type?this.headers.set(\\"content-type\\",this._bodyBlob.type):Hm&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set(\\"content-type\\",\\"application/x-www-form-urlencoded;charset=UTF-8\\"))},Km&&(this.blob=function(){var t=eb(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error(\\"could not read FormData body as blob\\");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?eb(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(nb)}),this.text=function(){var t=eb(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=rb(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?e:t}(e.method||this.method||\\"GET\\"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(\\"GET\\"===this.method||\\"HEAD\\"===this.method)&&r)throw new TypeError(\\"Body not allowed for GET or HEAD requests\\");this._initBody(r)}function sb(t){var e=new FormData;return t.trim().split(\\"&\\").forEach(function(t){if(t){var r=t.split(\\"=\\"),n=r.shift().replace(/\\\\+/g,\\" \\"),o=r.join(\\"=\\").replace(/\\\\+/g,\\" \\");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function cb(t,e){e||(e={}),this.type=\\"default\\",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=\\"statusText\\"in e?e.statusText:\\"OK\\",this.headers=new tb(e.headers),this.url=e.url||\\"\\",this._initBody(t)}ub.prototype.clone=function(){return new ub(this,{body:this._bodyInit})},ib.call(ub.prototype),ib.call(cb.prototype),cb.prototype.clone=function(){return new cb(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new tb(this.headers),url:this.url})},cb.error=function(){var t=new cb(null,{status:0,statusText:\\"\\"});return t.type=\\"error\\",t};var fb=[301,302,303,307,308];cb.redirect=function(t,e){if(-1===fb.indexOf(e))throw new RangeError(\\"Invalid status code\\");return new cb(null,{status:e,headers:{location:t}})};var lb=self.DOMException;try{new lb}catch(t){(lb=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),lb.prototype.constructor=lb}function hb(t,e){return new Promise(function(r,n){var o=new ub(t,e);if(o.signal&&o.signal.aborted)return n(new lb(\\"Aborted\\",\\"AbortError\\"));var i=new XMLHttpRequest;function a(){i.abort()}i.onload=function(){var t,e,n={status:i.status,statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||\\"\\",e=new tb,t.replace(/\\\\r?\\\\n[\\\\t ]+/g,\\" \\").split(/\\\\r?\\\\n/).forEach(function(t){var r=t.split(\\":\\"),n=r.shift().trim();if(n){var o=r.join(\\":\\").trim();e.append(n,o)}}),e)};n.url=\\"responseURL\\"in i?i.responseURL:n.headers.get(\\"X-Request-URL\\"),r(new cb(\\"response\\"in i?i.response:i.responseText,n))},i.onerror=function(){n(new TypeError(\\"Network request failed\\"))},i.ontimeout=function(){n(new TypeError(\\"Network request failed\\"))},i.onabort=function(){n(new lb(\\"Aborted\\",\\"AbortError\\"))},i.open(o.method,o.url,!0),\\"include\\"===o.credentials?i.withCredentials=!0:\\"omit\\"===o.credentials&&(i.withCredentials=!1),\\"responseType\\"in i&&Km&&(i.responseType=\\"blob\\"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),o.signal&&(o.signal.addEventListener(\\"abort\\",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener(\\"abort\\",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})}hb.polyfill=!0,self.fetch||(self.fetch=hb,self.Headers=tb,self.Request=ub,self.Response=cb);var pb=Object.getOwnPropertySymbols,vb=Object.prototype.hasOwnProperty,db=Object.prototype.propertyIsEnumerable,gb=function(){try{if(!Object.assign)return!1;var t=new String(\\"abc\\");if(t[5]=\\"de\\",\\"5\\"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e[\\"_\\"+String.fromCharCode(r)]=r;if(\\"0123456789\\"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(\\"\\"))return!1;var n={};return\\"abcdefghijklmnopqrst\\".split(\\"\\").forEach(function(t){n[t]=t}),\\"abcdefghijklmnopqrst\\"===Object.keys(Object.assign({},n)).join(\\"\\")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,n,o=function(t){if(null==t)throw new TypeError(\\"Object.assign cannot be called with null or undefined\\");return Object(t)}(t),i=1;i{\\"use strict\\";var e,t,r,o,n,i,a,u,l={},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}},o=!0;try{l[e](r,r.exports,d),o=!1}finally{o&&delete c[e]}return r.exports}d.m=l,e=[],d.O=(t,r,o,n)=>{if(r){n=n||0;for(var i=e.length;i>0&&e[i-1][2]>n;i--)e[i]=e[i-1];e[i]=[r,o,n];return}for(var a=1/0,i=0;i=n)&&Object.keys(d.O).every(e=>d.O[e](r[l]))?r.splice(l--,1):(u=!1,n{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,o){if(1&o&&(e=this(e)),8&o||\\"object\\"==typeof e&&e&&(4&o&&e.__esModule||16&o&&\\"function\\"==typeof e.then))return e;var n=Object.create(null);d.r(n);var i={};t=t||[null,r({}),r([]),r(r)];for(var a=2&o&&e;\\"object\\"==typeof a&&!~t.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,d.d(n,i),n},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,r)=>(d.f[r](e,t),t),[])),d.u=e=>\\"static/chunks/\\"+e+\\".\\"+({494:\\"0bfdf534d4777fad\\",763:\\"361bd0be0cf1ba1f\\"})[e]+\\".js\\",d.miniCssF=e=>{},d.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},d.l=(e,t,r,n)=>{if(o[e])return void o[e].push(t);if(void 0!==r)for(var i,a,u=document.getElementsByTagName(\\"script\\"),l=0;l{i.onerror=i.onload=null,clearTimeout(s);var n=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(r)),t)return t(r)},s=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),a&&document.head.appendChild(i)},d.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},d.tt=()=>(void 0===n&&(n={createScriptURL:e=>e},\\"undefined\\"!=typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy(\\"nextjs#bundler\\",n))),n),d.tu=e=>d.tt().createScriptURL(e),d.p=\\"/_next/\\",i={68:0},d.f.j=(e,t)=>{var r=d.o(i,e)?i[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(68!=e){var o=new Promise((t,o)=>r=i[e]=[t,o]);t.push(r[2]=o);var n=d.p+d.u(e),a=Error();d.l(n,t=>{if(d.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var o=t&&(\\"load\\"===t.type?\\"missing\\":t.type),n=t&&t.target&&t.target.src;a.message=\\"Loading chunk \\"+e+\\" failed.\\\\n(\\"+o+\\": \\"+n+\\")\\",a.name=\\"ChunkLoadError\\",a.type=o,a.request=n,r[1](a)}},\\"chunk-\\"+e,e)}else i[e]=0},d.O.j=e=>0===i[e],a=(e,t)=>{var r,o,[n,a,u]=t,l=0;if(n.some(e=>0!==i[e])){for(r in a)d.o(a,r)&&(d.m[r]=a[r]);if(u)var c=u(d)}for(e&&e(t);l:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity,1))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(241 245 249/var(--tw-divide-opacity,1))}.divide-slate-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(226 232 240/var(--tw-divide-opacity,1))}.divide-slate-50>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(248 250 252/var(--tw-divide-opacity,1))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\\\[2\\\\.5rem\\\\]{border-radius:2.5rem}.rounded-\\\\[2rem\\\\]{border-radius:2rem}.rounded-\\\\[3rem\\\\]{border-radius:3rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity:1;border-color:rgb(253 230 138/var(--tw-border-opacity,1))}.border-amber-500{--tw-border-opacity:1;border-color:rgb(245 158 11/var(--tw-border-opacity,1))}.border-amber-600{--tw-border-opacity:1;border-color:rgb(217 119 6/var(--tw-border-opacity,1))}.border-blue-100{--tw-border-opacity:1;border-color:rgb(219 234 254/var(--tw-border-opacity,1))}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-200\\\\/50{border-color:rgb(229 231 235/.5)}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.border-gray-50{--tw-border-opacity:1;border-color:rgb(249 250 251/var(--tw-border-opacity,1))}.border-green-100{--tw-border-opacity:1;border-color:rgb(220 252 231/var(--tw-border-opacity,1))}.border-indigo-100{--tw-border-opacity:1;border-color:rgb(224 231 255/var(--tw-border-opacity,1))}.border-indigo-200{--tw-border-opacity:1;border-color:rgb(199 210 254/var(--tw-border-opacity,1))}.border-indigo-500{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.border-indigo-600{--tw-border-opacity:1;border-color:rgb(79 70 229/var(--tw-border-opacity,1))}.border-indigo-700{--tw-border-opacity:1;border-color:rgb(67 56 202/var(--tw-border-opacity,1))}.border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.border-red-100{--tw-border-opacity:1;border-color:rgb(254 226 226/var(--tw-border-opacity,1))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity,1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.border-red-500\\\\/50{border-color:rgb(239 68 68/.5)}.border-slate-100{--tw-border-opacity:1;border-color:rgb(241 245 249/var(--tw-border-opacity,1))}.border-slate-200{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.border-slate-50{--tw-border-opacity:1;border-color:rgb(248 250 252/var(--tw-border-opacity,1))}.border-slate-600{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity,1))}.border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.border-slate-800{--tw-border-opacity:1;border-color:rgb(30 41 59/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1))}.border-white\\\\/10{border-color:rgb(255 255 255/.1)}.border-white\\\\/30{border-color:rgb(255 255 255/.3)}.border-yellow-100{--tw-border-opacity:1;border-color:rgb(254 249 195/var(--tw-border-opacity,1))}.border-yellow-200{--tw-border-opacity:1;border-color:rgb(254 240 138/var(--tw-border-opacity,1))}.bg-\\\\[\\\\#F8FAFC\\\\]{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(245 158 11/var(--tw-bg-opacity,1))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-black\\\\/50{background-color:rgb(0 0 0/.5)}.bg-black\\\\/60{background-color:rgb(0 0 0/.6)}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-emerald-100{--tw-bg-opacity:1;background-color:rgb(209 250 229/var(--tw-bg-opacity,1))}.bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgb(16 185 129/var(--tw-bg-opacity,1))}.bg-emerald-600{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-100\\\\/50{background-color:rgb(243 244 246/.5)}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-gray-50\\\\/30{background-color:rgb(249 250 251/.3)}.bg-gray-50\\\\/50{background-color:rgb(249 250 251/.5)}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.bg-green-600{--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity,1))}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(224 231 255/var(--tw-bg-opacity,1))}.bg-indigo-400{--tw-bg-opacity:1;background-color:rgb(129 140 248/var(--tw-bg-opacity,1))}.bg-indigo-50{--tw-bg-opacity:1;background-color:rgb(238 242 255/var(--tw-bg-opacity,1))}.bg-indigo-50\\\\/50{background-color:rgb(238 242 255/.5)}.bg-indigo-500{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.bg-indigo-500\\\\/20{background-color:rgb(99 102 241/.2)}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(79 70 229/var(--tw-bg-opacity,1))}.bg-indigo-700{--tw-bg-opacity:1;background-color:rgb(67 56 202/var(--tw-bg-opacity,1))}.bg-indigo-800{--tw-bg-opacity:1;background-color:rgb(55 48 163/var(--tw-bg-opacity,1))}.bg-indigo-900{--tw-bg-opacity:1;background-color:rgb(49 46 129/var(--tw-bg-opacity,1))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1))}.bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-200{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-red-500\\\\/20{background-color:rgb(239 68 68/.2)}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.bg-rose-50{--tw-bg-opacity:1;background-color:rgb(255 241 242/var(--tw-bg-opacity,1))}.bg-rose-600{--tw-bg-opacity:1;background-color:rgb(225 29 72/var(--tw-bg-opacity,1))}.bg-sky-200{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity,1))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.bg-slate-50\\\\/30{background-color:rgb(248 250 252/.3)}.bg-slate-50\\\\/50{background-color:rgb(248 250 252/.5)}.bg-slate-50\\\\/80{background-color:rgb(248 250 252/.8)}.bg-slate-700{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.bg-slate-900{--tw-bg-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity,1))}.bg-slate-900\\\\/50{background-color:rgb(15 23 42/.5)}.bg-slate-950{--tw-bg-opacity:1;background-color:rgb(2 6 23/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white\\\\/10{background-color:rgb(255 255 255/.1)}.bg-white\\\\/20{background-color:rgb(255 255 255/.2)}.bg-white\\\\/5{background-color:rgb(255 255 255/.05)}.bg-white\\\\/95{background-color:rgb(255 255 255/.95)}.bg-yellow-400{--tw-bg-opacity:1;background-color:rgb(250 204 21/var(--tw-bg-opacity,1))}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(254 252 232/var(--tw-bg-opacity,1))}.bg-yellow-50\\\\/50{background-color:rgb(254 252 232/.5)}.bg-opacity-50{--tw-bg-opacity:0.5}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-indigo-600{--tw-gradient-from:#4f46e5 var(--tw-gradient-from-position);--tw-gradient-to:rgb(79 70 229/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-red-600{--tw-gradient-from:#dc2626 var(--tw-gradient-from-position);--tw-gradient-to:rgb(220 38 38/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-slate-50{--tw-gradient-from:#f8fafc var(--tw-gradient-from-position);--tw-gradient-to:rgb(248 250 252/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-slate-800{--tw-gradient-from:#1e293b var(--tw-gradient-from-position);--tw-gradient-to:rgb(30 41 59/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to:#2563eb var(--tw-gradient-to-position)}.to-indigo-900{--tw-gradient-to:#312e81 var(--tw-gradient-to-position)}.to-rose-600{--tw-gradient-to:#e11d48 var(--tw-gradient-to-position)}.to-slate-100{--tw-gradient-to:#f1f5f9 var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to:#0f172a var(--tw-gradient-to-position)}.p-0{padding:0}.p-1{padding:.25rem}.p-1\\\\.5{padding:.375rem}.p-10{padding:2.5rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\\\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-12{padding-bottom:3rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-4{padding-bottom:1rem}.pl-12{padding-left:3rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\\\[10px\\\\]{font-size:10px}.text-\\\\[11px\\\\]{font-size:11px}.text-\\\\[9px\\\\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-\\\\[0\\\\.2em\\\\]{letter-spacing:.2em}.tracking-tighter{letter-spacing:-.05em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.text-amber-600{--tw-text-opacity:1;color:rgb(217 119 6/var(--tw-text-opacity,1))}.text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}.text-amber-900{--tw-text-opacity:1;color:rgb(120 53 15/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.text-emerald-400{--tw-text-opacity:1;color:rgb(52 211 153/var(--tw-text-opacity,1))}.text-emerald-500{--tw-text-opacity:1;color:rgb(16 185 129/var(--tw-text-opacity,1))}.text-emerald-600{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.text-indigo-100{--tw-text-opacity:1;color:rgb(224 231 255/var(--tw-text-opacity,1))}.text-indigo-200{--tw-text-opacity:1;color:rgb(199 210 254/var(--tw-text-opacity,1))}.text-indigo-400{--tw-text-opacity:1;color:rgb(129 140 248/var(--tw-text-opacity,1))}.text-indigo-500{--tw-text-opacity:1;color:rgb(99 102 241/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity,1))}.text-indigo-700{--tw-text-opacity:1;color:rgb(67 56 202/var(--tw-text-opacity,1))}.text-indigo-800{--tw-text-opacity:1;color:rgb(55 48 163/var(--tw-text-opacity,1))}.text-indigo-900{--tw-text-opacity:1;color:rgb(49 46 129/var(--tw-text-opacity,1))}.text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.text-orange-700{--tw-text-opacity:1;color:rgb(194 65 12/var(--tw-text-opacity,1))}.text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.text-rose-500{--tw-text-opacity:1;color:rgb(244 63 94/var(--tw-text-opacity,1))}.text-rose-600{--tw-text-opacity:1;color:rgb(225 29 72/var(--tw-text-opacity,1))}.text-sky-800{--tw-text-opacity:1;color:rgb(7 89 133/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-white\\\\/70{color:rgb(255 255 255/.7)}.text-white\\\\/80{color:rgb(255 255 255/.8)}.text-yellow-600{--tw-text-opacity:1;color:rgb(202 138 4/var(--tw-text-opacity,1))}.text-yellow-800{--tw-text-opacity:1;color:rgb(133 77 14/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity,1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity,1))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0/0.1),0 1px 2px -1px rgb(0 0 0/0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgb(0 0 0/0.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-\\\\[0_0_8px_rgba\\\\(74\\\\2c 222\\\\2c 128\\\\2c 0\\\\.8\\\\)\\\\]{--tw-shadow:0 0 8px rgba(74,222,128,0.8);--tw-shadow-colored:0 0 8px var(--tw-shadow-color)}.shadow-\\\\[0_0_8px_rgba\\\\(74\\\\2c 222\\\\2c 128\\\\2c 0\\\\.8\\\\)\\\\],.shadow-inner{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 rgb(0 0 0/0.05);--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgb(0 0 0/0.1),0 4px 6px -4px rgb(0 0 0/0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0/0.1),0 2px 4px -2px rgb(0 0 0/0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgb(0 0 0/0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-sm,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgb(0 0 0/0.1),0 8px 10px -6px rgb(0 0 0/0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.shadow-indigo-500\\\\/20{--tw-shadow-color:rgb(99 102 241/0.2);--tw-shadow:var(--tw-shadow-colored)}.shadow-slate-900\\\\/20{--tw-shadow-color:rgb(15 23 42/0.2);--tw-shadow:var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-amber-300{--tw-ring-opacity:1;--tw-ring-color:rgb(252 211 77/var(--tw-ring-opacity,1))}.ring-indigo-50{--tw-ring-opacity:1;--tw-ring-color:rgb(238 242 255/var(--tw-ring-opacity,1))}.blur-2xl{--tw-blur:blur(40px)}.blur-2xl,.blur-xl{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-xl{--tw-blur:blur(24px)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px)}.backdrop-blur,.backdrop-blur-md{backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-transform{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}#__next,body,html{height:100%;margin:0;padding:0;background-color:#f8fafc}.fc{--fc-border-color:#e2e8f0;--fc-button-bg-color:#4f46e5;--fc-button-border-color:#4f46e5;--fc-button-hover-bg-color:#4338ca;font-family:inherit}.fc .fc-toolbar-title{font-size:1.25rem!important;font-weight:700!important;color:#1e293b}.hover\\\\:z-30:hover{z-index:30}.hover\\\\:z-50:hover{z-index:50}.hover\\\\:-translate-y-0\\\\.5:hover{--tw-translate-y:-0.125rem}.hover\\\\:-translate-y-0\\\\.5:hover,.hover\\\\:scale-\\\\[1\\\\.01\\\\]:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\\\:scale-\\\\[1\\\\.01\\\\]:hover{--tw-scale-x:1.01;--tw-scale-y:1.01}.hover\\\\:border-indigo-100:hover{--tw-border-opacity:1;border-color:rgb(224 231 255/var(--tw-border-opacity,1))}.hover\\\\:border-indigo-200:hover{--tw-border-opacity:1;border-color:rgb(199 210 254/var(--tw-border-opacity,1))}.hover\\\\:border-indigo-300:hover{--tw-border-opacity:1;border-color:rgb(165 180 252/var(--tw-border-opacity,1))}.hover\\\\:border-indigo-400:hover{--tw-border-opacity:1;border-color:rgb(129 140 248/var(--tw-border-opacity,1))}.hover\\\\:border-indigo-500:hover{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.hover\\\\:bg-black:hover{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.hover\\\\:bg-blue-100:hover{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.hover\\\\:bg-emerald-700:hover{--tw-bg-opacity:1;background-color:rgb(4 120 87/var(--tw-bg-opacity,1))}.hover\\\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\\\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\\\\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.hover\\\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.hover\\\\:bg-gray-900:hover{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.hover\\\\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.hover\\\\:bg-indigo-100:hover{--tw-bg-opacity:1;background-color:rgb(224 231 255/var(--tw-bg-opacity,1))}.hover\\\\:bg-indigo-50:hover{--tw-bg-opacity:1;background-color:rgb(238 242 255/var(--tw-bg-opacity,1))}.hover\\\\:bg-indigo-50\\\\/20:hover{background-color:rgb(238 242 255/.2)}.hover\\\\:bg-indigo-50\\\\/30:hover{background-color:rgb(238 242 255/.3)}.hover\\\\:bg-indigo-50\\\\/50:hover{background-color:rgb(238 242 255/.5)}.hover\\\\:bg-indigo-500:hover{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.hover\\\\:bg-indigo-700:hover{--tw-bg-opacity:1;background-color:rgb(67 56 202/var(--tw-bg-opacity,1))}.hover\\\\:bg-red-100:hover{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.hover\\\\:bg-red-50:hover{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.hover\\\\:bg-red-500\\\\/10:hover{background-color:rgb(239 68 68/.1)}.hover\\\\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.hover\\\\:bg-rose-700:hover{--tw-bg-opacity:1;background-color:rgb(190 18 60/var(--tw-bg-opacity,1))}.hover\\\\:bg-slate-200:hover{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.hover\\\\:bg-slate-50:hover{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.hover\\\\:bg-slate-50\\\\/50:hover{background-color:rgb(248 250 252/.5)}.hover\\\\:bg-slate-800:hover{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.hover\\\\:bg-slate-800\\\\/50:hover{background-color:rgb(30 41 59/.5)}.hover\\\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.hover\\\\:bg-white\\\\/30:hover{background-color:rgb(255 255 255/.3)}.hover\\\\:bg-white\\\\/50:hover{background-color:rgb(255 255 255/.5)}.hover\\\\:text-blue-900:hover{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.hover\\\\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.hover\\\\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.hover\\\\:text-indigo-600:hover{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity,1))}.hover\\\\:text-indigo-900:hover{--tw-text-opacity:1;color:rgb(49 46 129/var(--tw-text-opacity,1))}.hover\\\\:text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\\\:text-red-600:hover{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.hover\\\\:text-red-900:hover{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.hover\\\\:text-rose-900:hover{--tw-text-opacity:1;color:rgb(136 19 55/var(--tw-text-opacity,1))}.hover\\\\:text-slate-300:hover{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.hover\\\\:text-slate-600:hover{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.hover\\\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgb(0 0 0/0.1),0 4px 6px -4px rgb(0 0 0/0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.hover\\\\:shadow-lg:hover,.hover\\\\:shadow-md:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgb(0 0 0/0.1),0 2px 4px -2px rgb(0 0 0/0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.hover\\\\:shadow-sm:hover{--tw-shadow:0 1px 2px 0 rgb(0 0 0/0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.hover\\\\:shadow-sm:hover,.hover\\\\:shadow-xl:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgb(0 0 0/0.1),0 8px 10px -6px rgb(0 0 0/0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.hover\\\\:brightness-110:hover{--tw-brightness:brightness(1.1)}.hover\\\\:brightness-110:hover,.hover\\\\:brightness-95:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\\\:brightness-95:hover{--tw-brightness:brightness(.95)}.focus\\\\:border-indigo-500:focus{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.focus\\\\:border-red-500:focus{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.focus\\\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\\\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.focus\\\\:ring-red-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(254 202 202/var(--tw-ring-opacity,1))}.focus\\\\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(239 68 68/var(--tw-ring-opacity,1))}.active\\\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\\\:bg-gray-100:disabled{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.disabled\\\\:bg-indigo-300:disabled{--tw-bg-opacity:1;background-color:rgb(165 180 252/var(--tw-bg-opacity,1))}.disabled\\\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\\\:translate-x-1{--tw-translate-x:0.25rem}.group:hover .group-hover\\\\:scale-110,.group:hover .group-hover\\\\:translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\\\\:scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1}.group:hover .group-hover\\\\:whitespace-normal{white-space:normal}.group:hover .group-hover\\\\:bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(224 231 255/var(--tw-bg-opacity,1))}.group:hover .group-hover\\\\:bg-slate-50\\\\/50{background-color:rgb(248 250 252/.5)}.group:hover .group-hover\\\\:text-indigo-400,.group\\\\/cell:hover .group-hover\\\\/cell\\\\:text-indigo-400{--tw-text-opacity:1;color:rgb(129 140 248/var(--tw-text-opacity,1))}.group:hover .group-hover\\\\:text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity,1))}.group:hover .group-hover\\\\:opacity-100,.group\\\\/col:hover .group-hover\\\\/col\\\\:opacity-100{opacity:1}@media (min-width:640px){.sm\\\\:max-w-xs{max-width:20rem}.sm\\\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\\\:flex-row{flex-direction:row}.sm\\\\:items-center{align-items:center}.sm\\\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:768px){.md\\\\:col-span-2{grid-column:span 2/span 2}.md\\\\:flex{display:flex}.md\\\\:w-auto{width:auto}.md\\\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\\\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\\\:flex-row{flex-direction:row}.md\\\\:items-center{align-items:center}}@media (min-width:1024px){.lg\\\\:w-96{width:24rem}.lg\\\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\\\\:flex-row{flex-direction:row}.lg\\\\:items-center{align-items:center}.lg\\\\:p-6{padding:1.5rem}.lg\\\\:text-left{text-align:left}}"},{"name":"package.json","path":"apps/web/package.json","area":"FRONTEND","folder":"WEB","content":"{\\n \\"name\\": \\"web\\",\\n \\"version\\": \\"0.1.0\\",\\n \\"private\\": true,\\n \\"scripts\\": {\\n \\"dev\\": \\"next dev\\",\\n \\"build\\": \\"next build\\",\\n \\"start\\": \\"next start\\",\\n \\"lint\\": \\"eslint\\"\\n },\\n \\"dependencies\\": {\\n \\"@fullcalendar/daygrid\\": \\"^6.1.19\\",\\n \\"@fullcalendar/interaction\\": \\"^6.1.19\\",\\n \\"@fullcalendar/react\\": \\"^6.1.19\\",\\n \\"@fullcalendar/timegrid\\": \\"^6.1.19\\",\\n \\"@react-google-maps/api\\": \\"^2.20.7\\",\\n \\"date-fns\\": \\"^4.1.0\\",\\n \\"firebase\\": \\"^12.6.0\\",\\n \\"lucide-react\\": \\"^0.556.0\\",\\n \\"next\\": \\"16.0.5\\",\\n \\"react\\": \\"19.2.0\\",\\n \\"react-dom\\": \\"19.2.0\\",\\n \\"react-hot-toast\\": \\"^2.6.0\\"\\n },\\n \\"devDependencies\\": {\\n \\"@tailwindcss/postcss\\": \\"^4\\",\\n \\"@types/node\\": \\"^20\\",\\n \\"@types/react\\": \\"^19\\",\\n \\"@types/react-dom\\": \\"^19\\",\\n \\"autoprefixer\\": \\"^10.4.22\\",\\n \\"eslint\\": \\"^9\\",\\n \\"eslint-config-next\\": \\"16.0.5\\",\\n \\"postcss\\": \\"^8.5.6\\",\\n \\"tailwindcss\\": \\"^3.4.17\\",\\n \\"typescript\\": \\"^5\\"\\n }\\n}\\n\\n\\n\\n\\n"},{"name":"absences.tsx","path":"apps/web/pages/admin/absences.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React from \'react\';\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\nimport { AbsenceManagementPage } from \'@/components/admin/AbsenceManagementPage\';\\n\\nexport default function GestióndeAusenciasPage() {\\n return (\\n \\n \\n \\n );\\n}"},{"name":"index.tsx","path":"apps/web/pages/admin/audit/index.tsx","area":"FRONTEND","folder":"AUDIT","content":"import React from \'react\';\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\nimport { useAuditLogs } from \'@/hooks/useAudit\';\\nimport { Shield, Clock, User, Activity } from \'lucide-react\';\\n\\nexport default function AuditPage() {\\n const { data: logs = [], isLoading } = useAuditLogs({ limit: 50 });\\n\\n return (\\n \\n
\\n
\\n
\\n

Registros de Actividad

\\n

Historial completo de acciones realizadas en la plataforma

\\n
\\n
\\n {logs.length} Registros\\n
\\n
\\n\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n {isLoading ? (\\n \\n \\n \\n ) : logs.length === 0 ? (\\n \\n \\n \\n ) : (\\n logs.map((log: any, i: number) => (\\n \\n \\n \\n \\n \\n \\n ))\\n )}\\n \\n
Fecha / HoraUsuarioAcciónMódulo
Cargando registros de auditoría...
No se encontraron registros de actividad
\\n
{log.timestampIso || \'---\'}
\\n
\\n
{log.changedBy || \'Sistema\'}
\\n
\\n \\n {log.action}\\n \\n \\n
{log.module || \'General\'}
\\n
\\n
\\n
\\n
\\n );\\n}"},{"name":"index.tsx","path":"apps/web/pages/admin/clients/index.tsx","area":"FRONTEND","folder":"CLIENTS","content":"import React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; // FIX: Importación por defecto\\r\\nimport { ClientManagement } from \'@/components/admin/client-management\';\\r\\n\\r\\nfunction ClientsListPage() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\nexport default withAuthGuard(ClientsListPage, [\'admin\', \'manager\']);\\n\\n\\n\\n"},{"name":"new.tsx","path":"apps/web/pages/admin/clients/new.tsx","area":"FRONTEND","folder":"CLIENTS","content":"// Archivo: pages/admin/clients/new.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\n// Imports con alias @/\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n\\r\\n// ✅ FIX: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\n\\r\\n// Importamos el componente Wizard que creamos antes\\r\\nimport { ClientSetupWizard } from \'@/components/admin/client-setup-wizard\';\\r\\n\\r\\n/**\\r\\n * Componente de la página de alta de nuevos clientes y servicios.\\r\\n */\\r\\nfunction NewClientPage() {\\r\\n return (\\r\\n \\r\\n
\\r\\n {/* Renderizamos el asistente aquí */}\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\n// Protegemos la ruta solo para admins (usamos array para consistencia con withAuthGuard corregido)\\r\\nexport default withAuthGuard(NewClientPage, [\'admin\']);\\n\\n\\n\\n"},{"name":"index.tsx","path":"apps/web/pages/admin/contracts/index.tsx","area":"FRONTEND","folder":"CONTRACTS","content":"import React from \'react\';\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\nimport { useQuery } from \'@tanstack/react-query\';\\nimport { collection, getDocs, query, where } from \'firebase/firestore\';\\nimport { db } from \'@/services/firebase-client.service\';\\nimport { useClient } from \'@/context/ClientContext\';\\nimport { FileText, Plus, Loader2, AlertCircle, CheckCircle2, Clock } from \'lucide-react\';\\n\\nexport default function ContractsPage() {\\n const { selectedClientId } = useClient();\\n\\n const { data: contracts = [], isLoading } = useQuery({\\n queryKey: [\'contracts-list\', selectedClientId],\\n queryFn: async () => {\\n const contractsRef = collection(db, \'contratos_servicio\');\\n const q = selectedClientId \\n ? query(contractsRef, where(\'clientId\', \'==\', selectedClientId))\\n : contractsRef;\\n const snap = await getDocs(q);\\n return snap.docs.map(d => ({ id: d.id, ...d.data() }));\\n }\\n });\\n\\n return (\\n \\n
\\n
\\n

\\n {contracts.length} Contratos encontrados\\n

\\n \\n
\\n\\n {isLoading ? (\\n
\\n ) : contracts.length === 0 ? (\\n
\\n \\n

No hay convenios cargados para esta selección

\\n
\\n ) : (\\n
\\n {contracts.map((c: any) => (\\n
\\n
\\n
\\n \\n {c.isActive ? \'Activo\' : \'Inactivo\'}\\n \\n
\\n

{c.name || \'Contrato sin nombre\'}

\\n

{c.objectiveName || \'Sin objetivo asignado\'}

\\n
\\n
\\n \\n {c.totalHoursPerMonth || 0}hs /mes\\n
\\n \\n
\\n
\\n ))}\\n
\\n )}\\n
\\n
\\n );\\n}"},{"name":"dashboard.tsx","path":"apps/web/pages/admin/dashboard.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useEffect, useState, useCallback, useMemo } from \'react\';\\r\\nimport Head from \'next/head\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { addDays, startOfWeek, addHours, format, startOfDay, differenceInHours } from \'date-fns\'; \\r\\nimport { \\r\\n Users, MapPin, Globe, Plus, RefreshCw, Trash2, Copy, X, Check, Building, AlertCircle, ArrowRight, UserX, Search, Filter, Clock, Eye, Briefcase\\r\\n} from \'lucide-react\';\\r\\nimport { collection, query, where, getDocs, Timestamp, limit } from \'firebase/firestore\';\\r\\n\\r\\n// --- IMPORTS ---\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { useClient } from \'@/context/ClientContext\';\\r\\nimport { \\r\\n callManageData, \\r\\n callManageEmployees, \\r\\n callScheduleShift, \\r\\n callManageShifts, \\r\\n callManagePatterns,\\r\\n getActiveContract, \\r\\n db \\r\\n} from \'@/services/firebase-client.service\';\\r\\nimport { IObjective } from \'@/common/interfaces/client.interface\'; \\r\\nimport { IEmployee, IAbsence } from \'@/common/interfaces/employee.interface\';\\r\\nimport { IShift } from \'@/common/interfaces/shift.interface\';\\r\\n\\r\\n// --- SCHEDULER ---\\r\\nimport { DragAndDropScheduler, SchedulerEvent } from \'@/components/admin/scheduler\';\\r\\nimport toast from \'react-hot-toast\';\\r\\n\\r\\ninterface PlanningStats {\\r\\n totalHours: number;\\r\\n vacancies: number;\\r\\n occupancyRate: number;\\r\\n}\\r\\n\\r\\ninterface ReplicateFormState {\\r\\n sourceDate: string;\\r\\n targetStart: string;\\r\\n targetEnd: string;\\r\\n targetDays: number[];\\r\\n}\\r\\n\\r\\nconst Dashboard = () => {\\r\\n const router = useRouter();\\r\\n const context = useClient();\\r\\n const client = (context as any)?.client || context?.selectedClient || null;\\r\\n const clientId = client?.id || \'\';\\r\\n\\r\\n // --- ESTADO DE DATOS ---\\r\\n const [shifts, setShifts] = useState([]);\\r\\n const [employees, setEmployees] = useState([]);\\r\\n const [objectives, setObjectives] = useState([]);\\r\\n const [absences, setAbsences] = useState([]);\\r\\n \\r\\n // Objetivo seleccionado\\r\\n const [selectedObjectiveId, setSelectedObjectiveId] = useState(\'\');\\r\\n\\r\\n // --- ESTADO DE UI ---\\r\\n const [loading, setLoading] = useState(false); \\r\\n const [stats, setStats] = useState({ totalHours: 0, vacancies: 0, occupancyRate: 0 });\\r\\n const [searchTerm, setSearchTerm] = useState(\'\');\\r\\n const [roleFilter, setRoleFilter] = useState(\'ALL\');\\r\\n\\r\\n // --- MODALES ---\\r\\n const [selectedShift, setSelectedShift] = useState(null);\\r\\n const [isDetailOpen, setIsDetailOpen] = useState(false);\\r\\n const [isReplicateOpen, setIsReplicateOpen] = useState(false);\\r\\n \\r\\n const getLocalDateString = () => {\\r\\n const d = new Date();\\r\\n const offset = d.getTimezoneOffset() * 60000;\\r\\n return new Date(d.getTime() - offset).toISOString().split(\'T\')[0];\\r\\n };\\r\\n\\r\\n const [replicateForm, setReplicateForm] = useState({\\r\\n sourceDate: getLocalDateString(),\\r\\n targetStart: getLocalDateString(),\\r\\n targetEnd: getLocalDateString(),\\r\\n targetDays: [1, 2, 3, 4, 5] \\r\\n });\\r\\n\\r\\n // --- 1. CARGA DE DATOS (FETCH) ---\\r\\n const fetchRealData = useCallback(async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const objPayload = clientId ? { clientId } : {}; \\r\\n \\r\\n const objRes = await callManageData({ action: \'GET_ALL_OBJECTIVES\', payload: objPayload });\\r\\n const loadedObjectives = (objRes.data as any).data as IObjective[];\\r\\n setObjectives(loadedObjectives);\\r\\n\\r\\n if (selectedObjectiveId && !loadedObjectives.find(o => o.id === selectedObjectiveId)) {\\r\\n setSelectedObjectiveId(\'\');\\r\\n }\\r\\n\\r\\n const empRes = await callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: objPayload });\\r\\n const loadedEmployees = (empRes.data as any).data as IEmployee[];\\r\\n setEmployees(loadedEmployees);\\r\\n\\r\\n // Ausencias Activas\\r\\n const absencesRef = collection(db, \'ausencias\');\\r\\n const todayStart = new Date(); todayStart.setHours(0,0,0,0);\\r\\n const absQuery = query(\\r\\n absencesRef,\\r\\n where(\'endDate\', \'>=\', Timestamp.fromDate(todayStart)),\\r\\n where(\'status\', \'==\', \'APPROVED\')\\r\\n );\\r\\n const absSnapshot = await getDocs(absQuery);\\r\\n const activeAbsences: IAbsence[] = [];\\r\\n absSnapshot.forEach(doc => activeAbsences.push({ id: doc.id, ...doc.data() } as unknown as IAbsence));\\r\\n setAbsences(activeAbsences);\\r\\n\\r\\n // Turnos\\r\\n const shiftsRef = collection(db, \'turnos\');\\r\\n let q;\\r\\n\\r\\n if (selectedObjectiveId) {\\r\\n const startLimit = new Date();\\r\\n startLimit.setMonth(startLimit.getMonth() - 1); \\r\\n q = query(\\r\\n shiftsRef, \\r\\n where(\'objectiveId\', \'==\', selectedObjectiveId),\\r\\n where(\'startTime\', \'>=\', Timestamp.fromDate(startLimit))\\r\\n );\\r\\n } else if (loadedObjectives.length > 0) {\\r\\n const objectiveIds = loadedObjectives.map(o => o.id).slice(0, 10);\\r\\n q = query(shiftsRef, where(\'objectiveId\', \'in\', objectiveIds));\\r\\n } else {\\r\\n setShifts([]);\\r\\n setStats({ totalHours: 0, vacancies: 0, occupancyRate: 0 });\\r\\n return;\\r\\n }\\r\\n \\r\\n const querySnapshot = await getDocs(q);\\r\\n const realShifts: IShift[] = [];\\r\\n querySnapshot.forEach((doc) => {\\r\\n const data = doc.data();\\r\\n realShifts.push({ id: doc.id, ...data } as IShift);\\r\\n });\\r\\n\\r\\n realShifts.sort((a, b) => {\\r\\n const tA = a.startTime instanceof Timestamp ? a.startTime.toMillis() : new Date(a.startTime).getTime();\\r\\n const tB = b.startTime instanceof Timestamp ? b.startTime.toMillis() : new Date(b.startTime).getTime();\\r\\n return tA - tB;\\r\\n });\\r\\n\\r\\n setShifts(realShifts);\\r\\n calculateStats(realShifts);\\r\\n\\r\\n } catch (error: any) {\\r\\n console.error(\\"Error cargando:\\", error);\\r\\n toast.error(error.message);\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n }, [clientId, selectedObjectiveId]);\\r\\n\\r\\n const calculateStats = (data: IShift[]) => {\\r\\n const total = data.length;\\r\\n const assigned = data.filter(s => s.employeeId !== \'VACANTE\').length;\\r\\n let totalHours = 0;\\r\\n data.forEach(s => {\\r\\n const start = s.startTime instanceof Timestamp ? s.startTime.toDate() : new Date(s.startTime);\\r\\n const end = s.endTime instanceof Timestamp ? s.endTime.toDate() : new Date(s.endTime);\\r\\n const hours = (end.getTime() - start.getTime()) / (1000 * 60 * 60);\\r\\n totalHours += hours;\\r\\n });\\r\\n setStats({\\r\\n totalHours: Math.round(totalHours), \\r\\n vacancies: total - assigned,\\r\\n occupancyRate: total > 0 ? Math.round((assigned / total) * 100) : 0\\r\\n });\\r\\n };\\r\\n\\r\\n useEffect(() => { fetchRealData(); }, [fetchRealData]);\\r\\n\\r\\n // --- 2. INTELIGENCIA DE RECURSOS (SMART SIDEBAR) ---\\r\\n const employeeHours = useMemo(() => {\\r\\n const hoursMap: Record = {};\\r\\n shifts.forEach(shift => {\\r\\n if (shift.employeeId && shift.employeeId !== \'VACANTE\') {\\r\\n const start = shift.startTime instanceof Timestamp ? shift.startTime.toDate() : new Date(shift.startTime);\\r\\n const end = shift.endTime instanceof Timestamp ? shift.endTime.toDate() : new Date(shift.endTime);\\r\\n const duration = differenceInHours(end, start);\\r\\n hoursMap[shift.employeeId] = (hoursMap[shift.employeeId] || 0) + duration;\\r\\n }\\r\\n });\\r\\n return hoursMap;\\r\\n }, [shifts]);\\r\\n\\r\\n const getEmployeeStatus = (empId: string) => {\\r\\n const hasAbsence = absences.find(a => a.employeeId === empId); \\r\\n if (hasAbsence) return { status: \'UNAVAILABLE\', reason: hasAbsence.type, hours: 0 };\\r\\n \\r\\n const hours = employeeHours[empId] || 0;\\r\\n if (hours > 48) return { status: \'OVERLOADED\', hours };\\r\\n if (hours > 0) return { status: \'BUSY\', hours };\\r\\n \\r\\n return { status: \'AVAILABLE\', hours: 0 };\\r\\n };\\r\\n\\r\\n const filteredEmployees = useMemo(() => {\\r\\n const list = employees.filter(emp => {\\r\\n const matchesSearch = emp.name.toLowerCase().includes(searchTerm.toLowerCase()) || \\r\\n (emp.dni && emp.dni.includes(searchTerm));\\r\\n \\r\\n const matchesRole = roleFilter === \'ALL\' || \\r\\n emp.role === roleFilter || \\r\\n (roleFilter === \'Vigilador\' && !emp.role); \\r\\n \\r\\n return matchesSearch && matchesRole;\\r\\n });\\r\\n\\r\\n return list.sort((a, b) => {\\r\\n const statA = getEmployeeStatus(a.uid);\\r\\n const statB = getEmployeeStatus(b.uid);\\r\\n\\r\\n const weight = (s: string) => {\\r\\n if (s === \'AVAILABLE\') return 1;\\r\\n if (s === \'BUSY\') return 2;\\r\\n if (s === \'OVERLOADED\') return 3;\\r\\n return 4; // UNAVAILABLE\\r\\n };\\r\\n\\r\\n return weight(statA.status) - weight(statB.status);\\r\\n });\\r\\n }, [employees, searchTerm, roleFilter, employeeHours, absences]);\\r\\n\\r\\n\\r\\n // --- 🛑 ACCIONES (LOGICA CORREGIDA) ---\\r\\n const handleDrop = async (data: { employeeId: string, employeeName: string, start?: Date, end?: Date, targetShiftId?: string }, isRetry = false) => {\\r\\n \\r\\n // 1. Validar Disponibilidad Local\\r\\n const status = getEmployeeStatus(data.employeeId);\\r\\n if (status.status === \'UNAVAILABLE\') {\\r\\n toast.error(`⛔ ${data.employeeName} tiene licencia activa.`);\\r\\n return;\\r\\n }\\r\\n\\r\\n let targetId = data.targetShiftId;\\r\\n\\r\\n // 2. 🛑 SMART SNAP: Si se soltó en espacio vacío, buscamos la vacante oculta\\r\\n if (!targetId && data.start && selectedObjectiveId) {\\r\\n const dropTime = data.start.getTime();\\r\\n \\r\\n // Buscamos un turno VACANTE en el objetivo que coincida con el horario del drop\\r\\n const candidateShift = shifts.find(s => {\\r\\n if (s.employeeId !== \'VACANTE\') return false;\\r\\n if (s.objectiveId !== selectedObjectiveId) return false;\\r\\n if (s.status === \'Canceled\') return false;\\r\\n\\r\\n const sStart = s.startTime instanceof Timestamp ? s.startTime.toMillis() : new Date(s.startTime).getTime();\\r\\n const sEnd = s.endTime instanceof Timestamp ? s.endTime.toMillis() : new Date(s.endTime).getTime();\\r\\n\\r\\n // Tolerancia: Si el drop cae dentro del rango del turno\\r\\n return dropTime >= sStart && dropTime < sEnd;\\r\\n });\\r\\n\\r\\n if (candidateShift) {\\r\\n targetId = candidateShift.id;\\r\\n console.log(\\"🎯 Vacante encontrada:\\", targetId);\\r\\n }\\r\\n }\\r\\n\\r\\n // 3. Ejecutar Asignación (Solo si tenemos un ID de turno destino)\\r\\n if (targetId) {\\r\\n const toastId = isRetry ? toast.loading(\\"Autorizando...\\") : toast.loading(\\"Asignando...\\");\\r\\n try {\\r\\n await callManageShifts({\\r\\n action: \'UPDATE_SHIFT\',\\r\\n payload: { \\r\\n id: targetId,\\r\\n data: { \\r\\n employeeId: data.employeeId, \\r\\n employeeName: data.employeeName,\\r\\n status: \'Assigned\' \\r\\n },\\r\\n authorizeOvertime: isRetry \\r\\n }\\r\\n });\\r\\n toast.success(isRetry ? \\"⚠️ Asignado (Exceso Autorizado)\\" : \\"Asignado correctamente\\", { id: toastId });\\r\\n fetchRealData();\\r\\n } catch (e: any) { \\r\\n if (e.message && (e.message.includes(\'LÍMITE EXCEDIDO\') || e.code === \'functions/resource-exhausted\')) {\\r\\n toast.dismiss(toastId);\\r\\n if (confirm(`⚠️ ALERTA DE HORAS EXTRA\\\\n\\\\n${e.message}\\\\n\\\\n¿Autorizar la asignación excediendo el límite?`)) {\\r\\n // Reintentamos pasando el targetId que encontramos\\r\\n handleDrop({ ...data, targetShiftId: targetId }, true); \\r\\n return;\\r\\n }\\r\\n } else {\\r\\n toast.error(e.message, { id: toastId, duration: 5000 }); \\r\\n }\\r\\n }\\r\\n return;\\r\\n }\\r\\n\\r\\n // 4. Si no encontró vacante, bloqueamos la creación accidental\\r\\n toast.error(\\"⛔ Acción no permitida: Arrastre el empleado sobre una tarjeta \'VACANTE\' existente.\\");\\r\\n };\\r\\n\\r\\n const handleGenerateStructure = async () => {\\r\\n // ... (sin cambios, código original)\\r\\n if (!selectedObjectiveId) return toast.error(\\"Seleccione un Objetivo.\\");\\r\\n const obj = objectives.find(o => o.id === selectedObjectiveId);\\r\\n if (!obj) return;\\r\\n setLoading(true);\\r\\n const toastId = toast.loading(\\"Buscando contrato...\\");\\r\\n try {\\r\\n const contract = await getActiveContract(obj.id);\\r\\n if (!contract) throw new Error(\\"No hay contrato activo.\\");\\r\\n if (!confirm(`Generar vacantes según contrato \\"${contract.name}\\"?`)) {\\r\\n setLoading(false); toast.dismiss(toastId); return;\\r\\n }\\r\\n toast.loading(\\"Generando vacantes...\\", { id: toastId });\\r\\n const today = new Date();\\r\\n const res = await callManagePatterns({\\r\\n action: \'GENERATE_VACANCIES\',\\r\\n payload: {\\r\\n contractId: contract.id,\\r\\n objectiveId: obj.id,\\r\\n month: today.getMonth() + 1,\\r\\n year: today.getFullYear()\\r\\n }\\r\\n });\\r\\n toast.success((res.data as any).message, { id: toastId });\\r\\n fetchRealData();\\r\\n } catch (e: any) {\\r\\n toast.error(e.message, { id: toastId });\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n const handleReplicate = async () => {\\r\\n // ... (sin cambios)\\r\\n if (!selectedObjectiveId) return toast.error(\\"Seleccione un objetivo.\\");\\r\\n setLoading(true);\\r\\n const toastId = toast.loading(\\"Replicando...\\");\\r\\n try {\\r\\n const res = await callManageShifts({\\r\\n action: \'REPLICATE_STRUCTURE\',\\r\\n payload: {\\r\\n objectiveId: selectedObjectiveId,\\r\\n sourceDate: replicateForm.sourceDate,\\r\\n targetStartDate: replicateForm.targetStart,\\r\\n targetEndDate: replicateForm.targetEnd,\\r\\n targetDays: replicateForm.targetDays\\r\\n }\\r\\n });\\r\\n const data = res.data as any;\\r\\n toast.success(data.message, { id: toastId });\\r\\n setIsReplicateOpen(false);\\r\\n fetchRealData();\\r\\n } catch (e: any) {\\r\\n toast.error(e.message, { id: toastId });\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n const handleClearStructure = async () => {\\r\\n // ... (sin cambios)\\r\\n if (!selectedObjectiveId) return toast.error(\\"Seleccione objetivo.\\");\\r\\n if (!confirm(\\"⚠️ Se eliminarán todas las VACANTES vacías del mes actual. ¿Seguro?\\")) return;\\r\\n setLoading(true);\\r\\n try {\\r\\n const today = new Date();\\r\\n await callManagePatterns({\\r\\n action: \'CLEAR_VACANCIES\',\\r\\n payload: { objectiveId: selectedObjectiveId, month: today.getMonth() + 1, year: today.getFullYear() }\\r\\n });\\r\\n toast.success(\\"Limpiado\\");\\r\\n fetchRealData();\\r\\n } catch (e: any) { toast.error(e.message); } \\r\\n finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n const handleDeleteShift = async () => {\\r\\n // ... (sin cambios)\\r\\n if (!selectedShift) return;\\r\\n const isVacancy = selectedShift.employeeId === \'VACANTE\';\\r\\n if (!confirm(isVacancy ? \\"Borrar vacante?\\" : \\"Desasignar empleado?\\")) return;\\r\\n try {\\r\\n if (isVacancy) {\\r\\n await callManageShifts({ action: \'DELETE_SHIFT\', payload: { id: selectedShift.id } });\\r\\n toast.success(\\"Eliminado\\");\\r\\n } else {\\r\\n await callManageShifts({\\r\\n action: \'UPDATE_SHIFT\',\\r\\n payload: { id: selectedShift.id, data: { employeeId: \'VACANTE\', employeeName: \'VACANTE\', status: \'Assigned\' } }\\r\\n });\\r\\n toast.success(\\"Desasignado\\");\\r\\n }\\r\\n setIsDetailOpen(false);\\r\\n fetchRealData();\\r\\n } catch (e: any) { toast.error(e.message); }\\r\\n };\\r\\n\\r\\n const handleDuplicateShift = async () => {\\r\\n // ... (sin cambios)\\r\\n if (!selectedShift) return;\\r\\n try {\\r\\n const start = selectedShift.startTime instanceof Timestamp ? selectedShift.startTime.toDate() : new Date(selectedShift.startTime);\\r\\n const end = selectedShift.endTime instanceof Timestamp ? selectedShift.endTime.toDate() : new Date(selectedShift.endTime);\\r\\n await callScheduleShift({\\r\\n employeeId: selectedShift.employeeId, employeeName: selectedShift.employeeName,\\r\\n objectiveId: selectedShift.objectiveId, objectiveName: selectedShift.objectiveName,\\r\\n startTime: start, endTime: end, status: \'Assigned\', role: selectedShift.role\\r\\n });\\r\\n toast.success(\\"Duplicado\\");\\r\\n setIsDetailOpen(false);\\r\\n fetchRealData();\\r\\n } catch (e: any) { toast.error(e.message); }\\r\\n };\\r\\n\\r\\n const onEventClick = (event: SchedulerEvent) => {\\r\\n setSelectedShift(event.originalData as IShift);\\r\\n setIsDetailOpen(true);\\r\\n };\\r\\n\\r\\n const toggleReplicateDay = (d: number) => {\\r\\n setReplicateForm(prev => {\\r\\n const exists = prev.targetDays.includes(d);\\r\\n const newDays = exists ? prev.targetDays.filter(day => day !== d) : [...prev.targetDays, d];\\r\\n return { ...prev, targetDays: newDays.sort() };\\r\\n });\\r\\n };\\r\\n\\r\\n const calendarEvents: SchedulerEvent[] = useMemo(() => {\\r\\n return shifts.map((shift) => {\\r\\n const startDate = shift.startTime instanceof Timestamp ? shift.startTime.toDate() : new Date(shift.startTime);\\r\\n const endDate = shift.endTime instanceof Timestamp ? shift.endTime.toDate() : new Date(shift.endTime);\\r\\n const isVacant = shift.employeeId === \'VACANTE\';\\r\\n const isGlobalView = !selectedObjectiveId;\\r\\n let title = isVacant ? \'VACANTE\' : shift.employeeName;\\r\\n if (isGlobalView) title = `${shift.objectiveName} | ${title}`;\\r\\n\\r\\n return {\\r\\n id: shift.id,\\r\\n title: title,\\r\\n description: shift.objectiveName,\\r\\n start: startDate,\\r\\n end: endDate, \\r\\n color: isVacant \\r\\n ? \'bg-gray-100 border-gray-400 text-gray-500 border-dashed\' \\r\\n : (shift.isOvertime \\r\\n ? \'bg-amber-100 border-amber-500 text-amber-900 ring-1 ring-amber-300\' \\r\\n : \'bg-indigo-100 border-indigo-600 text-indigo-900\'),\\r\\n originalData: shift \\r\\n };\\r\\n });\\r\\n }, [shifts, selectedObjectiveId]);\\r\\n\\r\\n const pageTitle = client?.businessName ? `Planificación - ${client.businessName}` : \'Centro de Control Global\';\\r\\n const isGlobalMode = !selectedObjectiveId;\\r\\n\\r\\n return (\\r\\n \\r\\n {pageTitle} | CronoApp\\r\\n
\\r\\n {/* HEADER */}\\r\\n
\\r\\n
\\r\\n
{clientId ? : }
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
Horas{stats.totalHours}
\\r\\n
Vacantes{stats.vacancies}
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n {/* SIDEBAR INTELIGENTE */}\\r\\n \\r\\n \\r\\n {/* SCHEDULER */}\\r\\n
\\r\\n
\\r\\n {isGlobalMode &&
Monitor (Solo Lectura)
}\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n {/* MODAL DETALLE */}\\r\\n {isDetailOpen && selectedShift && (\\r\\n
\\r\\n
\\r\\n

Gestionar Turno

\\r\\n
\\r\\n

{selectedShift.employeeName === \'VACANTE\' ? \'🔴 VACANTE\' : selectedShift.employeeName}

\\r\\n
\\r\\n

{format(selectedShift.startTime instanceof Timestamp ? selectedShift.startTime.toDate() : new Date(selectedShift.startTime), \'HH:mm\')}

\\r\\n

{format(selectedShift.endTime instanceof Timestamp ? selectedShift.endTime.toDate() : new Date(selectedShift.endTime), \'HH:mm\')}

\\r\\n
\\r\\n {selectedShift.isOvertime &&
Horas Extra Autorizadas
}\\r\\n
\\r\\n {!isGlobalMode && (\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* MODAL REPLICAR */}\\r\\n {isReplicateOpen && (\\r\\n
\\r\\n
\\r\\n

Copiar Días

\\r\\n
\\r\\n

Copiar estructura del día origen al rango seleccionado.

\\r\\n
setReplicateForm({...replicateForm, sourceDate: e.target.value})} />
\\r\\n
Aplica a
\\r\\n
\\r\\n
setReplicateForm({...replicateForm, targetStart: e.target.value})} />
\\r\\n
setReplicateForm({...replicateForm, targetEnd: e.target.value})} />
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n {[\'D\',\'L\',\'M\',\'M\',\'J\',\'V\',\'S\'].map((day, i) => (\\r\\n \\r\\n ))}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n );\\r\\n};\\r\\n\\r\\nexport default withAuthGuard(Dashboard);\\n\\n\\n\\n"},{"name":"employees.tsx","path":"apps/web/pages/admin/employees.tsx","area":"FRONTEND","folder":"ADMIN","content":"// Archivo: pages/admin/employees.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\nimport { EmployeeManagement } from \'@/components/admin/employee-management\';\\r\\n\\r\\nfunction EmployeesPage() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida (asumo roles de administración y RRHH)\\r\\nexport default withAuthGuard(EmployeesPage, [\'admin\', \'hr_manager\']);\\n\\n\\n\\n"},{"name":"home.tsx","path":"apps/web/pages/admin/home.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useEffect, useState } from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { \\r\\n Activity, AlertTriangle, Users, Calendar, ArrowRight, \\r\\n ShieldAlert, FileEdit, Trash2, PlusCircle, MapPin, Copy, CheckCircle2\\r\\n} from \'lucide-react\';\\r\\nimport { httpsCallable } from \'firebase/functions\';\\r\\nimport { functions, db, callManageEmployees } from \'@/services/firebase-client.service\';\\r\\nimport { collection, query, where, getDocs, Timestamp } from \'firebase/firestore\';\\r\\nimport Link from \'next/link\';\\r\\nimport { useAuth } from \'@/context/AuthContext\';\\r\\n\\r\\n// Llamadas a Cloud Functions\\r\\nconst callManageAudits = httpsCallable(functions, \'manageAudits\');\\r\\nconst callManageSystemUsers = httpsCallable(functions, \'manageSystemUsers\');\\r\\n\\r\\nfunction HomePage() {\\r\\n const { user: currentUser } = useAuth();\\r\\n const [stats, setStats] = useState({ vacanciesToday: 0, activeStaff: 0, absentToday: 0, coverage: 0 });\\r\\n const [recentLogs, setRecentLogs] = useState([]);\\r\\n const [usersMap, setUsersMap] = useState>({});\\r\\n const [loading, setLoading] = useState(true);\\r\\n\\r\\n useEffect(() => {\\r\\n loadDashboardData();\\r\\n }, [currentUser]);\\r\\n\\r\\n const loadDashboardData = async () => {\\r\\n try {\\r\\n // 1. CARGA DE NOMBRES (Prioridad: Mapa Global)\\r\\n const map: Record = {};\\r\\n \\r\\n // A. Usuario Actual (Fallback inmediato)\\r\\n if (currentUser?.uid) {\\r\\n map[currentUser.uid] = currentUser.displayName || \'Tú (Admin)\';\\r\\n }\\r\\n\\r\\n // B. Cargar Empleados (Guardias)\\r\\n try {\\r\\n const empRes = await callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: {} });\\r\\n (empRes.data as any).data?.forEach((u: any) => { if(u.uid) map[u.uid] = u.name; });\\r\\n } catch (e) { console.error(\\"Error loading employees\\", e); }\\r\\n\\r\\n // C. Cargar Admins del Sistema\\r\\n try {\\r\\n const sysRes = await callManageSystemUsers({ action: \'GET_ALL_USERS\', payload: {} });\\r\\n (sysRes.data as any).data?.forEach((u: any) => { if(u.uid) map[u.uid] = u.name; });\\r\\n } catch (e) { console.error(\\"Error loading admins\\", e); }\\r\\n\\r\\n setUsersMap(map);\\r\\n\\r\\n // 2. KPIs (Estadísticas del día)\\r\\n const todayStart = new Date(); todayStart.setHours(0,0,0,0);\\r\\n const todayEnd = new Date(); todayEnd.setHours(23,59,59,999);\\r\\n \\r\\n // Turnos de hoy\\r\\n const shiftsRef = collection(db, \'turnos\');\\r\\n const qShifts = query(shiftsRef, where(\'startTime\', \'>=\', Timestamp.fromDate(todayStart)), where(\'startTime\', \'<=\', Timestamp.fromDate(todayEnd)));\\r\\n const shiftsSnap = await getDocs(qShifts);\\r\\n \\r\\n let total = 0, assigned = 0, vacancies = 0;\\r\\n shiftsSnap.forEach(doc => { \\r\\n const d = doc.data(); \\r\\n if(d.status !== \'Canceled\') { \\r\\n total++; \\r\\n if(d.employeeId === \'VACANTE\') vacancies++; \\r\\n else assigned++; \\r\\n } \\r\\n });\\r\\n \\r\\n // Ausencias de hoy\\r\\n const absRef = collection(db, \'ausencias\');\\r\\n const qAbs = query(absRef, where(\'endDate\', \'>=\', Timestamp.fromDate(todayStart)), where(\'status\', \'==\', \'APPROVED\'));\\r\\n const absSnap = await getDocs(qAbs);\\r\\n\\r\\n setStats({ \\r\\n vacanciesToday: vacancies, \\r\\n activeStaff: assigned, \\r\\n absentToday: absSnap.size, \\r\\n coverage: total > 0 ? Math.round((assigned / total) * 100) : 0 \\r\\n });\\r\\n\\r\\n // 3. AUDITORÍA (Últimos 10 registros para el widget)\\r\\n const auditRes = await callManageAudits({ action: \'GET_GLOBAL_LOGS\', payload: { limit: 10 } });\\r\\n setRecentLogs((auditRes.data as any).data || []);\\r\\n\\r\\n } catch (error) { \\r\\n console.error(error); \\r\\n } finally { \\r\\n setLoading(false); \\r\\n }\\r\\n };\\r\\n\\r\\n // --- TRADUCTORES VISUALES (Iconos y Textos) ---\\r\\n const getLogIcon = (action: string) => {\\r\\n switch (action) {\\r\\n case \'CREATE\': return ;\\r\\n case \'UPDATE\': return ;\\r\\n case \'DELETE\': return ;\\r\\n case \'CHECK_IN\': return ;\\r\\n case \'REPLICATE\': return ;\\r\\n default: return ;\\r\\n }\\r\\n };\\r\\n\\r\\n const renderLogMessage = (log: any) => {\\r\\n const d = log.details || {};\\r\\n \\r\\n if (log.action === \'CREATE\') return Creó un turno para {d.employee || \'Vacante\'} en {d.objective}.;\\r\\n if (log.action === \'DELETE\') return Eliminó un turno de {d.employee} ({new Date(d.date).toLocaleDateString()}).;\\r\\n if (log.action === \'UPDATE\') {\\r\\n let msg = \\"Actualizó un turno.\\";\\r\\n if (d.before?.start !== d.after?.start) msg = \\"Cambió el horario.\\";\\r\\n if (d.before?.emp !== d.after?.emp) msg = `Reasignó de ${d.before?.emp || \'Vacante\'} a ${d.after?.emp || \'Vacante\'}.`;\\r\\n return {msg};\\r\\n }\\r\\n if (log.action === \'CHECK_IN\') return Fichó entrada vía App.;\\r\\n if (log.action === \'REPLICATE\') return Replicación masiva ({d.count} turnos).;\\r\\n\\r\\n return Acción: {log.action};\\r\\n };\\r\\n\\r\\n // Helper para obtener nombre (evita mostrar UID)\\r\\n const getUserName = (uid: string) => {\\r\\n if (usersMap[uid]) return usersMap[uid];\\r\\n if (currentUser?.uid === uid) return currentUser.displayName || \'Tú\';\\r\\n return \'Usuario Desconocido\';\\r\\n };\\r\\n\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n {/* KPIs (Indicadores) */}\\r\\n
\\r\\n
\\r\\n

Cobertura Hoy

{stats.coverage}%

\\r\\n
\\r\\n
\\r\\n
\\r\\n

Vacantes Críticas

{stats.vacanciesToday}

\\r\\n
\\r\\n
\\r\\n
\\r\\n

Guardias Activos

{stats.activeStaff}

\\r\\n
\\r\\n
\\r\\n
\\r\\n

Ausencias / Lic

{stats.absentToday}

\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n {/* Accesos Rápidos */}\\r\\n
\\r\\n
\\r\\n

Bienvenido, {currentUser?.displayName || \'Admin\'}

\\r\\n

Seleccione una acción para comenzar su gestión operativa.

\\r\\n
\\r\\n \\r\\n
\\r\\n
PlanificadorGrilla Interactiva
\\r\\n \\r\\n \\r\\n
\\r\\n
Matriz GeneralVista Sábana
\\r\\n \\r\\n \\r\\n
\\r\\n
NovedadesCargar Licencias
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n {/* Estado del Sistema */}\\r\\n
\\r\\n

Estado del Sistema

\\r\\n
\\r\\n
\\r\\n Conexión a Base de Datos\\r\\n ESTABLE\\r\\n
\\r\\n
\\r\\n Motor de Reglas (Francos/Horas)\\r\\n ACTIVO\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Actividad Reciente */}\\r\\n
\\r\\n
\\r\\n

\\r\\n Actividad Reciente\\r\\n

\\r\\n Ver Historial \\r\\n
\\r\\n
\\r\\n {recentLogs.length === 0 &&

No hay movimientos recientes.

}\\r\\n \\r\\n {recentLogs.map((log, i) => {\\r\\n const date = new Date(log.timestampIso);\\r\\n const userName = getUserName(log.changedBy);\\r\\n const userInitial = userName.charAt(0).toUpperCase();\\r\\n \\r\\n return (\\r\\n
\\r\\n {/* Línea conectora */}\\r\\n {i !== recentLogs.length - 1 &&
}\\r\\n \\r\\n
\\r\\n {userInitial}\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n {userName}\\r\\n \\r\\n {date.toLocaleTimeString([], {hour:\'2-digit\', minute:\'2-digit\'})}\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
{getLogIcon(log.action)}
\\r\\n
{renderLogMessage(log)}
\\r\\n
\\r\\n
\\r\\n
\\r\\n )\\r\\n })}\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\n// 🛑 FIX FINAL: Lista explícita de todos los roles de administración permitidos\\r\\nexport default withAuthGuard(HomePage, [\'admin\', \'SuperAdmin\', \'Director\', \'Scheduler\']);\\n\\n"},{"name":"labor-agreements.tsx","path":"apps/web/pages/admin/labor-agreements.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { LaborAgreementsManager } from \'@/components/admin/labor-agreements-manager\';\\r\\n\\r\\nfunction LaborAgreementsPage() {\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\nexport default withAuthGuard(LaborAgreementsPage, [\'admin\', \'hr_manager\']);\\n\\n\\n\\n"},{"name":"mapa-completo.tsx","path":"apps/web/pages/admin/mapa-completo.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState } from \'react\';\\n\\nexport default function AuditMap() {\\n const [sel, setSel] = useState(null);\\n const data = [\\n { n: \\"Core & Architecture\\", c: [\\n { id: 1, name: \\"AuthContext.tsx\\", d: \\"Manejo de Firebase Auth y Custom Claims.\\", p: \\"apps/web/src/context/AuthContext.tsx\\" },\\n { id: 2, name: \\"ThemeContext.tsx\\", d: \\"Infraestructura de temas dinámicos.\\", p: \\"apps/web/src/context/ThemeContext.tsx\\" },\\n { id: 3, name: \\"_app.tsx\\", d: \\"Raíz de Next.js y Providers globales.\\", p: \\"apps/web/pages/_app.tsx\\" },\\n { id: 4, name: \\"_document.tsx\\", d: \\"Estructura HTML base del sitio.\\", p: \\"apps/web/pages/_document.tsx\\" }\\n ]},\\n { n: \\"Administración\\", c: [\\n { id: 5, name: \\"system-user-management.tsx\\", d: \\"Gestión de personal, roles y personalización.\\", p: \\"src/components/admin/system-user-management.tsx\\" },\\n { id: 6, name: \\"dashboard.tsx\\", d: \\"Vista principal de control administrativo.\\", p: \\"pages/admin/dashboard.tsx\\" }\\n ]},\\n { n: \\"Componentes Atómicos\\", c: [\\n { id: 7, name: \\"Button.tsx\\", d: \\"Botón estandarizado con variantes.\\", p: \\"src/components/common/Button.tsx\\" },\\n { id: 8, name: \\"InputField.tsx\\", d: \\"Entrada de texto con validación.\\", p: \\"src/components/common/InputField.tsx\\" },\\n { id: 9, name: \\"SelectField.tsx\\", d: \\"Selector de opciones personalizado.\\", p: \\"src/components/common/SelectField.tsx\\" },\\n { id: 10, name: \\"withAuthGuard.tsx\\", d: \\"HOC de protección de rutas.\\", p: \\"src/components/common/withAuthGuard.tsx\\" }\\n ]},\\n { n: \\"Layout & Servicios\\", c: [\\n { id: 11, name: \\"DashboardLayout.tsx\\", d: \\"Estructura envolvente del dashboard.\\", p: \\"src/components/layout/DashboardLayout.tsx\\" },\\n { id: 12, name: \\"Sidebar.tsx\\", d: \\"Navegación lateral por permisos.\\", p: \\"src/components/layout/Sidebar.tsx\\" },\\n { id: 13, name: \\"firebase-client.service.ts\\", d: \\"Instancia del SDK de Firebase.\\", p: \\"src/services/firebase-client.service.ts\\" }\\n ]},\\n { n: \\"Mantenimiento & Raíz\\", c: [\\n { id: 14, name: \\"set-admin-role.js\\", d: \\"Script de asignación de rol administrador.\\", p: \\"/set-admin-role.js\\" },\\n { id: 15, name: \\"set-employee-role.js\\", d: \\"Script de asignación de rol empleado.\\", p: \\"/set-employee-role.js\\" }\\n ]}\\n ];\\n\\n return (\\n
\\n
\\n

Audit Map Completo

\\n {data.map((folder, i) => (\\n
\\n

{folder.n}

\\n
\\n {folder.c.map(file => (\\n
setSel(file)} className={\\"p-3 text-[11px] font-bold cursor-pointer rounded-xl transition-all \\" + (sel?.id === file.id ? \\"bg-indigo-600 text-white shadow-lg\\" : \\"hover:bg-slate-50 text-slate-600\\")}>\\n {file.name}\\n
\\n ))}\\n
\\n
\\n ))}\\n
\\n
\\n {sel ? (\\n
\\n

{sel.name}

\\n
{sel.p}
\\n
\\n

\\"{sel.d}\\"

\\n
\\n
\\n ) :

Selecciona un archivo

}\\n
\\n
\\n );\\n}"},{"name":"[id].tsx","path":"apps/web/pages/admin/objective-detail/[id].tsx","area":"FRONTEND","folder":"OBJECTIVE-DETAIL","content":"import React, { useEffect, useState } from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\'; \\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { useClient } from \'@/context/ClientContext\';\\r\\nimport { \\r\\n getObjectiveControlData, \\r\\n getObjectiveContracts, \\r\\n createServiceForObjective,\\r\\n updateServiceContract, \\r\\n deleteServiceContract, \\r\\n callScheduleShift, \\r\\n callManageEmployees,\\r\\n getShiftTypes,\\r\\n createShiftType,\\r\\n updateShiftType,\\r\\n deleteShiftType,\\r\\n updateObjective,\\r\\n createPattern // 🛑 IMPORTANTE: Para automatizar la regla\\r\\n} from \'@/services/firebase-client.service\';\\r\\nimport { IObjective, IServiceContract, IShiftType } from \'@/common/interfaces/client.interface\';\\r\\nimport { IShift } from \'@/common/interfaces/shift.interface\';\\r\\nimport { IEmployee } from \'@/common/interfaces/employee.interface\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { GeocodingSelector } from \'@/components/admin/GeocodingSelector\';\\r\\nimport { \\r\\n LayoutDashboard, Settings, MapPin, AlertTriangle, \\r\\n Plus, Trash2, Edit2, FileText, Users, CalendarDays, Clock, Calculator, X \\r\\n} from \'lucide-react\';\\r\\n\\r\\ntype TabView = \'operations\' | \'config\' | \'map\';\\r\\n\\r\\nfunction ObjectiveDetailPage() {\\r\\n const router = useRouter();\\r\\n const { id } = router.query;\\r\\n const { clients } = useClient();\\r\\n\\r\\n // Datos\\r\\n const [objective, setObjective] = useState(null);\\r\\n const [shifts, setShifts] = useState([]);\\r\\n const [contracts, setContracts] = useState([]);\\r\\n const [employees, setEmployees] = useState([]); \\r\\n \\r\\n // UI\\r\\n const [loading, setLoading] = useState(true);\\r\\n const [activeTab, setActiveTab] = useState(\'operations\');\\r\\n \\r\\n // Modales\\r\\n const [showServiceModal, setShowServiceModal] = useState(false);\\r\\n const [editingContract, setEditingContract] = useState(null);\\r\\n const [showShiftModal, setShowShiftModal] = useState(false);\\r\\n const [showModalitiesModal, setShowModalitiesModal] = useState(false);\\r\\n const [showEditObjectiveModal, setShowEditObjectiveModal] = useState(false);\\r\\n const [showGeoSelector, setShowGeoSelector] = useState(false);\\r\\n\\r\\n // Forms\\r\\n const [serviceForm, setServiceForm] = useState({ \\r\\n name: \'\', \\r\\n hours: 720, \\r\\n isActive: true, \\r\\n quantity: 1, \\r\\n days: [0,1,2,3,4,5,6], // Default Lunes a Domingo\\r\\n startDate: \'\', \\r\\n endDate: \'\' \\r\\n });\\r\\n \\r\\n // 🛑 ESTADO PARA CÁLCULO PREDICTIVO\\r\\n const [serviceMetrics, setServiceMetrics] = useState({ totalVacancies: 0, estimatedHours: 0 });\\r\\n\\r\\n const [shiftForm, setShiftForm] = useState({ employeeId: \'\', start: \'\', end: \'\' });\\r\\n const [modalityForm, setModalityForm] = useState({ id: \'\', name: \'\', code: \'\', startTime: \'07:00\', durationHours: 12 });\\r\\n const [editObjForm, setEditObjForm] = useState({ name: \'\', address: \'\', clientId: \'\', latitude: \'\', longitude: \'\' });\\r\\n\\r\\n const [selectedContractForModalities, setSelectedContractForModalities] = useState(null);\\r\\n const [contractShiftTypes, setContractShiftTypes] = useState([]);\\r\\n const [isEditingModality, setIsEditingModality] = useState(false);\\r\\n\\r\\n // --- CARGA DE DATOS ---\\r\\n const loadData = async () => {\\r\\n if (!id) return;\\r\\n try {\\r\\n const [controlData, contractData] = await Promise.all([\\r\\n getObjectiveControlData(id as string),\\r\\n getObjectiveContracts(id as string)\\r\\n ]);\\r\\n setObjective(controlData.objective);\\r\\n setShifts(controlData.shifts);\\r\\n setContracts(contractData);\\r\\n } catch (error) { console.error(error); } finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n const loadEmployees = async () => {\\r\\n try {\\r\\n const res = await callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: {} });\\r\\n setEmployees((res.data as any).data || []);\\r\\n } catch (e) { console.error(e); }\\r\\n };\\r\\n\\r\\n useEffect(() => {\\r\\n loadData();\\r\\n loadEmployees();\\r\\n const interval = setInterval(loadData, 60000);\\r\\n return () => clearInterval(interval);\\r\\n }, [id]);\\r\\n\\r\\n // 🛑 CALCULADORA EN TIEMPO REAL (Para Modal de Servicio)\\r\\n useEffect(() => {\\r\\n if (serviceForm.startDate && serviceForm.quantity) {\\r\\n const start = new Date(serviceForm.startDate);\\r\\n const end = serviceForm.endDate \\r\\n ? new Date(serviceForm.endDate) \\r\\n : new Date(start.getFullYear(), start.getMonth() + 1, 0); // Fin de mes default\\r\\n \\r\\n let workingDays = 0;\\r\\n // Iteramos para contar días hábiles según la selección\\r\\n for (let d = new Date(start); d <= end; d.setDate(d.getDate() + 1)) {\\r\\n if (serviceForm.days.includes(d.getDay())) workingDays++;\\r\\n }\\r\\n \\r\\n // Estimación: Asumimos 24hs de cobertura por defecto para la proyección inicial\\r\\n // (Ya que aún no hay turnos definidos). O usamos 24 * quantity.\\r\\n const estimatedDailyHours = 24 * serviceForm.quantity; \\r\\n \\r\\n setServiceMetrics({\\r\\n totalVacancies: workingDays * serviceForm.quantity, // Días * Dotación (simplificado)\\r\\n estimatedHours: workingDays * estimatedDailyHours\\r\\n });\\r\\n }\\r\\n }, [serviceForm]);\\r\\n\\r\\n\\r\\n // Helpers\\r\\n const getDateObj = (ts: any) => {\\r\\n if (!ts) return new Date();\\r\\n if (ts.toDate) return ts.toDate();\\r\\n if (ts instanceof Date) return ts;\\r\\n if (typeof ts === \'string\') return new Date(ts);\\r\\n if (ts.seconds) return new Date(ts.seconds * 1000);\\r\\n return new Date();\\r\\n };\\r\\n const formatDate = (ts: any) => getDateObj(ts).toLocaleTimeString(\'es-AR\', { hour: \'2-digit\', minute: \'2-digit\', timeZone: \'UTC\' });\\r\\n \\r\\n const renderDaysBadges = (days: number[]) => {\\r\\n const week = [\'D\',\'L\',\'M\',\'M\',\'J\',\'V\',\'S\'];\\r\\n if (days.length === 7) return Todos los días (24x7);\\r\\n return (\\r\\n
\\r\\n {week.map((d, i) => (\\r\\n \\r\\n {d}\\r\\n \\r\\n ))}\\r\\n
\\r\\n );\\r\\n };\\r\\n\\r\\n // KPIs Visuales\\r\\n const activeShifts = shifts.filter(s => s.status === \'InProgress\');\\r\\n const upcomingShifts = shifts.filter(s => s.status === \'Assigned\' && getDateObj(s.startTime) > new Date());\\r\\n const issueShifts = shifts.filter(s => s.status === \'Canceled\' || (s.status === \'Assigned\' && new Date() > getDateObj(s.startTime)));\\r\\n const hasAlerts = issueShifts.length > 0;\\r\\n\\r\\n // --- HANDLERS OBJETIVO ---\\r\\n const handleOpenEditObjective = () => {\\r\\n if (!objective) return;\\r\\n setEditObjForm({\\r\\n name: objective.name,\\r\\n address: objective.address,\\r\\n clientId: objective.clientId,\\r\\n latitude: String(objective.location.latitude),\\r\\n longitude: String(objective.location.longitude)\\r\\n });\\r\\n setShowEditObjectiveModal(true);\\r\\n };\\r\\n\\r\\n const handleSaveObjective = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n if (!objective) return;\\r\\n const toastId = toast.loading(\\"Actualizando...\\");\\r\\n try {\\r\\n await updateObjective(objective.id, {\\r\\n name: editObjForm.name,\\r\\n address: editObjForm.address,\\r\\n clientId: editObjForm.clientId,\\r\\n location: { latitude: parseFloat(editObjForm.latitude), longitude: parseFloat(editObjForm.longitude) }\\r\\n });\\r\\n toast.success(\\"Sede actualizada\\", { id: toastId });\\r\\n setShowEditObjectiveModal(false);\\r\\n loadData();\\r\\n } catch (error: any) { toast.error(error.message, { id: toastId }); }\\r\\n };\\r\\n\\r\\n const handleGeoSelected = (lat: string, lng: string) => {\\r\\n setEditObjForm(prev => ({ ...prev, latitude: lat, longitude: lng }));\\r\\n setShowGeoSelector(false);\\r\\n };\\r\\n\\r\\n // --- HANDLERS SERVICIO ---\\r\\n const handleSaveService = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n if (!serviceForm.startDate) { toast.error(\\"Fecha de inicio obligatoria\\"); return; }\\r\\n const toastId = toast.loading(\\"Procesando...\\");\\r\\n try {\\r\\n const payload = {\\r\\n name: serviceForm.name,\\r\\n totalHours: serviceForm.hours,\\r\\n isActive: serviceForm.isActive,\\r\\n quantity: serviceForm.quantity,\\r\\n daysOfWeek: serviceForm.days,\\r\\n startDate: new Date(serviceForm.startDate).toISOString(),\\r\\n endDate: serviceForm.endDate ? new Date(serviceForm.endDate).toISOString() : undefined\\r\\n };\\r\\n if (editingContract) {\\r\\n await updateServiceContract(editingContract.id, payload);\\r\\n toast.success(\\"Servicio actualizado\\", { id: toastId });\\r\\n } else {\\r\\n await createServiceForObjective({ objectiveId: id as string, ...payload as any });\\r\\n toast.success(\\"Servicio creado\\", { id: toastId });\\r\\n }\\r\\n setShowServiceModal(false); setEditingContract(null); loadData();\\r\\n } catch (e: any) { toast.error(e.message, { id: toastId }); }\\r\\n };\\r\\n\\r\\n const handleDeleteService = async (contractId: string) => {\\r\\n if (!confirm(\\"¿Eliminar servicio?\\")) return;\\r\\n try { await deleteServiceContract(contractId); toast.success(\\"Eliminado\\"); loadData(); } catch (e: any) { toast.error(e.message); }\\r\\n };\\r\\n\\r\\n const openEditService = (c: IServiceContract) => {\\r\\n setEditingContract(c);\\r\\n const formatInput = (v: any) => v ? getDateObj(v).toISOString().split(\'T\')[0] : \'\';\\r\\n setServiceForm({ \\r\\n name: c.name, hours: c.totalHoursPerMonth, isActive: c.isActive,\\r\\n quantity: c.quantity || 1, days: c.daysOfWeek || [0,1,2,3,4,5,6],\\r\\n startDate: formatInput(c.startDate), endDate: formatInput(c.endDate)\\r\\n });\\r\\n setShowServiceModal(true); \\r\\n };\\r\\n\\r\\n const openNewService = () => { \\r\\n setEditingContract(null);\\r\\n const today = new Date().toISOString().split(\'T\')[0];\\r\\n setServiceForm({ name: \'\', hours: 720, isActive: true, quantity: 1, days: [0,1,2,3,4,5,6], startDate: today, endDate: \'\' });\\r\\n setShowServiceModal(true); \\r\\n };\\r\\n\\r\\n // --- HANDLERS MODALIDADES ---\\r\\n const openModalitiesManager = async (contract: IServiceContract) => {\\r\\n setSelectedContractForModalities(contract);\\r\\n const types = await getShiftTypes(contract.id);\\r\\n setContractShiftTypes(types);\\r\\n setModalityForm({ id: \'\', name: \'\', code: \'\', startTime: \'07:00\', durationHours: 12 });\\r\\n setIsEditingModality(false);\\r\\n setShowModalitiesModal(true);\\r\\n };\\r\\n\\r\\n // 🛑 LÓGICA DE ALTA DE MODALIDAD + PATRÓN AUTOMÁTICO\\r\\n const handleSaveModality = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n if (!selectedContractForModalities) return;\\r\\n const toastId = toast.loading(\\"Guardando...\\");\\r\\n try {\\r\\n if (isEditingModality) {\\r\\n await updateShiftType(modalityForm.id, { ...modalityForm });\\r\\n toast.success(\\"Actualizado\\", { id: toastId });\\r\\n } else {\\r\\n // 1. Crear Tipo de Turno\\r\\n const res = await createShiftType({ contractId: selectedContractForModalities.id, color: \'#4F46E5\', ...modalityForm });\\r\\n const newShiftType = (res.data as any).data;\\r\\n\\r\\n // 2. Crear Patrón Automático (Usando datos del contrato padre)\\r\\n // Esto asegura que al ir al planificador ya existan reglas.\\r\\n const cStart = getDateObj(selectedContractForModalities.startDate);\\r\\n const cEnd = selectedContractForModalities.endDate ? getDateObj(selectedContractForModalities.endDate) : undefined;\\r\\n \\r\\n await createPattern({\\r\\n contractId: selectedContractForModalities.id,\\r\\n shiftTypeId: newShiftType.id,\\r\\n daysOfWeek: selectedContractForModalities.daysOfWeek || [0,1,2,3,4,5,6],\\r\\n quantity: 1, // Base 1 persona\\r\\n validFrom: cStart.toISOString(),\\r\\n validTo: cEnd?.toISOString()\\r\\n });\\r\\n toast.success(\\"Modalidad y Regla creadas\\", { id: toastId });\\r\\n }\\r\\n \\r\\n const types = await getShiftTypes(selectedContractForModalities.id);\\r\\n setContractShiftTypes(types);\\r\\n \\r\\n if (!isEditingModality) setModalityForm({ id: \'\', name: \'\', code: \'\', startTime: \'07:00\', durationHours: 12 });\\r\\n setIsEditingModality(false);\\r\\n } catch (e: any) { toast.error(e.message, { id: toastId }); }\\r\\n };\\r\\n\\r\\n const handleEditModality = (m: IShiftType) => {\\r\\n setModalityForm({ id: m.id, name: m.name, code: m.code, startTime: m.startTime, durationHours: m.durationHours });\\r\\n setIsEditingModality(true);\\r\\n };\\r\\n\\r\\n const handleDeleteModality = async (id: string) => {\\r\\n if (!confirm(\\"¿Borrar?\\")) return;\\r\\n await deleteShiftType(id);\\r\\n if (selectedContractForModalities) {\\r\\n const types = await getShiftTypes(selectedContractForModalities.id);\\r\\n setContractShiftTypes(types);\\r\\n }\\r\\n };\\r\\n\\r\\n // --- HANDLER TURNO MANUAL ---\\r\\n const handleCreateShift = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n if (!objective) return;\\r\\n const emp = employees.find(e => e.uid === shiftForm.employeeId);\\r\\n if (!emp) return toast.error(\\"Seleccione empleado\\");\\r\\n const toastId = toast.loading(\\"Asignando...\\");\\r\\n try {\\r\\n await callScheduleShift({\\r\\n employeeId: emp.uid, employeeName: emp.name,\\r\\n objectiveId: objective.id, objectiveName: objective.name,\\r\\n startTime: new Date(shiftForm.start), endTime: new Date(shiftForm.end),\\r\\n status: \'Assigned\'\\r\\n });\\r\\n toast.success(\\"Turno creado\\", { id: toastId });\\r\\n setShowShiftModal(false); loadData();\\r\\n } catch (e: any) { toast.error(e.message, { id: toastId }); }\\r\\n };\\r\\n\\r\\n if (loading) return Loading...;\\r\\n if (!objective) return 404 - Objetivo no encontrado;\\r\\n\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n {/* Header */}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

{objective.name}

\\r\\n \\r\\n {hasAlerts && ALERTA}\\r\\n
\\r\\n

{objective.address}

\\r\\n
\\r\\n
\\r\\n

En Servicio

{activeShifts.length}

\\r\\n

Pendientes

{upcomingShifts.length}

\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Tabs */}\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n {/* OPERATIONS */}\\r\\n {activeTab === \'operations\' && (\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n

En Servicio

\\r\\n
\\r\\n {activeShifts.length === 0 &&

Sin actividad.

}\\r\\n {activeShifts.map(s =>
{s.employeeName}{formatDate(s.checkInTime)}
)}\\r\\n
\\r\\n
\\r\\n
\\r\\n

Próximos

\\r\\n
\\r\\n {upcomingShifts.length === 0 &&

Sin ingresos.

}\\r\\n {upcomingShifts.map(s =>
{s.employeeName}{formatDate(s.startTime)}
)}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* CONFIG (SERVICIOS) */}\\r\\n {activeTab === \'config\' && (\\r\\n
\\r\\n
\\r\\n

Servicios Contratados

\\r\\n \\r\\n
\\r\\n
\\r\\n {contracts.map(c => (\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

{c.name}

\\r\\n {c.isActive ? \'ACTIVO\' : \'INACTIVO\'}\\r\\n
\\r\\n
\\r\\n
\\r\\n
Dotación{c.quantity || 1} Pers.
\\r\\n
Cobertura
{renderDaysBadges(c.daysOfWeek || [])}
\\r\\n
Total{c.totalHoursPerMonth} hs
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n ))}\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* MODAL EDITAR OBJETIVO */}\\r\\n {showEditObjectiveModal && (\\r\\n
\\r\\n
\\r\\n

Editar Sede

\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n setEditObjForm({...editObjForm, name: e.target.value})} placeholder=\\"Nombre\\" required />\\r\\n setEditObjForm({...editObjForm, address: e.target.value})} placeholder=\\"Dirección\\" required />\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n \\r\\n setShowGeoSelector(false)} onCoordinatesSelected={handleGeoSelected} />\\r\\n\\r\\n {/* MODAL SERVICIO (CON CALCULADORA PREDICTIVA) */}\\r\\n {showServiceModal && (\\r\\n
\\r\\n
\\r\\n

{editingContract ? \'Editar Servicio\' : \'Nuevo Servicio\'}

\\r\\n \\r\\n {/* 🛑 PANEL PREDICTIVO */}\\r\\n
\\r\\n
\\r\\n

Estimación

\\r\\n

{serviceMetrics.estimatedHours} hs/mes

\\r\\n

~{serviceMetrics.totalVacancies} vacantes proyectadas

\\r\\n
\\r\\n
serviceForm.hours ? \'text-red-500\' : \'text-emerald-500\'}`}>\\r\\n {serviceMetrics.estimatedHours > serviceForm.hours ? \'⚠\' : \'✓\'}\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
setServiceForm({...serviceForm, name: e.target.value})} required />
\\r\\n
\\r\\n
setServiceForm({...serviceForm, hours: +e.target.value})} required />
\\r\\n
setServiceForm({...serviceForm, quantity: +e.target.value})} required />
\\r\\n
\\r\\n
\\r\\n
setServiceForm({...serviceForm, startDate: e.target.value})} required />
\\r\\n
setServiceForm({...serviceForm, endDate: e.target.value})} />
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n {[\'Dom\',\'Lun\',\'Mar\',\'Mié\',\'Jue\',\'Vie\',\'Sáb\'].map((day, index) => {\\r\\n const isSelected = serviceForm.days.includes(index);\\r\\n return \\r\\n })}\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* MODAL MODALIDADES */}\\r\\n {showModalitiesModal && selectedContractForModalities && (\\r\\n
\\r\\n
\\r\\n
\\r\\n

Modalidades

{selectedContractForModalities.name}

\\r\\n \\r\\n
\\r\\n
\\r\\n {contractShiftTypes.map(t => (\\r\\n
\\r\\n

{t.name} ({t.code})

{t.startTime} • {t.durationHours}hs

\\r\\n
\\r\\n
\\r\\n ))}\\r\\n
\\r\\n
\\r\\n

{isEditingModality ? \'Editar\' : \'Nueva\'}

\\r\\n
\\r\\n setModalityForm({...modalityForm, name: e.target.value})} required />\\r\\n setModalityForm({...modalityForm, code: e.target.value})} required />\\r\\n setModalityForm({...modalityForm, startTime: e.target.value})} required />\\r\\n setModalityForm({...modalityForm, durationHours: +e.target.value})} required />\\r\\n
\\r\\n
\\r\\n {isEditingModality && }\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* MODAL TURNO MANUAL */}\\r\\n {showShiftModal && (\\r\\n
\\r\\n
\\r\\n

Asignación Manual

\\r\\n
\\r\\n \\r\\n
\\r\\n setShiftForm({...shiftForm, start: e.target.value})} required />\\r\\n setShiftForm({...shiftForm, end: e.target.value})} required />\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\nexport default withAuthGuard(ObjectiveDetailPage, [\'admin\', \'manager\', \'supervisor\']);\\n\\n\\n\\n"},{"name":"objective-management.tsx","path":"apps/web/pages/admin/objective-management.tsx","area":"FRONTEND","folder":"ADMIN","content":"// Archivo: pages/admin/objective-management.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\nimport ObjectiveManagement from \'@/components/admin/objective-management\'; // Asumo exportación por defecto\\r\\n\\r\\nfunction ObjectiveManagementPage() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida\\r\\nexport default withAuthGuard(ObjectiveManagementPage, [\'admin\']);\\n\\n\\n\\n"},{"name":"objectives.tsx","path":"apps/web/pages/admin/objectives.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React from \'react\';\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\n\\nexport default function GestióndeObjetivosPage() {\\n return (\\n \\n
\\n

Módulo restaurado. Cargando datos...

\\n
\\n
\\n );\\n}"},{"name":"map.tsx","path":"apps/web/pages/admin/operations/map.tsx","area":"FRONTEND","folder":"OPERATIONS","content":"import React, { useEffect, useState, useMemo, useCallback } from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { callManageData } from \'@/services/firebase-client.service\';\\r\\nimport { IObjective } from \'@/common/interfaces/client.interface\';\\r\\nimport { GoogleMap, useJsApiLoader, Marker, InfoWindow } from \'@react-google-maps/api\';\\r\\nimport { \\r\\n MapPin, Search, ArrowRight, Building2, \\r\\n AlertTriangle, Users, Activity, Navigation \\r\\n} from \'lucide-react\';\\r\\nimport { useClient } from \'@/context/ClientContext\'; \\r\\n\\r\\n// --- CONFIGURACIÓN DEL MAPA ---\\r\\nconst containerStyle = { width: \'100%\', height: \'100%\' };\\r\\nconst defaultCenter = { lat: -34.6037, lng: -58.3816 }; // Buenos Aires Default\\r\\n\\r\\n// Estilo \\"Silver\\" limpio para uso profesional (menos distracciones)\\r\\nconst mapOptions: google.maps.MapOptions = {\\r\\n disableDefaultUI: true,\\r\\n zoomControl: true,\\r\\n fullscreenControl: true,\\r\\n styles: [\\r\\n { elementType: \\"geometry\\", stylers: [{ color: \\"#f5f5f5\\" }] },\\r\\n { elementType: \\"labels.icon\\", stylers: [{ visibility: \\"off\\" }] },\\r\\n { elementType: \\"labels.text.fill\\", stylers: [{ color: \\"#616161\\" }] },\\r\\n { elementType: \\"labels.text.stroke\\", stylers: [{ color: \\"#f5f5f5\\" }] },\\r\\n { featureType: \\"road\\", elementType: \\"geometry\\", stylers: [{ color: \\"#ffffff\\" }] },\\r\\n { featureType: \\"water\\", elementType: \\"geometry\\", stylers: [{ color: \\"#c9c9c9\\" }] },\\r\\n { featureType: \\"water\\", elementType: \\"labels.text.fill\\", stylers: [{ color: \\"#9e9e9e\\" }] }\\r\\n ]\\r\\n};\\r\\n\\r\\n// --- ICONOS DE MAPA DINÁMICOS ---\\r\\nconst getMarkerIcon = (status: \'ok\' | \'alert\' | \'warning\') => {\\r\\n let color = \'#10B981\'; // Verde (Operativo)\\r\\n if (status === \'alert\') color = \'#EF4444\'; // Rojo (Problema)\\r\\n if (status === \'warning\') color = \'#F59E0B\'; // Amarillo (Atención)\\r\\n\\r\\n return {\\r\\n path: \\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z M12 11.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\\",\\r\\n fillColor: color,\\r\\n fillOpacity: 1,\\r\\n strokeWeight: 1.5,\\r\\n strokeColor: \\"#FFFFFF\\",\\r\\n scale: 1.8,\\r\\n anchor: { x: 12, y: 22 }\\r\\n } as google.maps.Symbol;\\r\\n};\\r\\n\\r\\n// Interfaz extendida para UI\\r\\ninterface IObjectiveMap extends IObjective {\\r\\n status: \'ok\' | \'alert\' | \'warning\';\\r\\n activePersonnel: number;\\r\\n}\\r\\n\\r\\nfunction OperatorMapPage() {\\r\\n const router = useRouter();\\r\\n const { selectedClientId, selectedClient } = useClient(); // Conexión con el selector global\\r\\n \\r\\n const [allObjectives, setAllObjectives] = useState([]);\\r\\n const [searchQuery, setSearchQuery] = useState(\'\');\\r\\n const [selectedObj, setSelectedObj] = useState(null);\\r\\n const [mapInstance, setMapInstance] = useState(null);\\r\\n \\r\\n const [stats, setStats] = useState({ total: 0, alerts: 0, active: 0 });\\r\\n\\r\\n const { isLoaded } = useJsApiLoader({\\r\\n id: \'google-map-script\',\\r\\n googleMapsApiKey: process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY || \'\'\\r\\n });\\r\\n\\r\\n // 1. CARGA DE DATOS (Reactiva al Filtro Global)\\r\\n useEffect(() => {\\r\\n const loadObjectives = async () => {\\r\\n try {\\r\\n // Si selectedClientId es \\"\\", el backend debe traer TODOS (ajustar backend si es necesario o manejarlo aquí)\\r\\n // Asumimos que manageData soporta payload vacío para traer todo si eres admin\\r\\n const payload = selectedClientId ? { clientId: selectedClientId } : {};\\r\\n const res = await callManageData({ action: \'GET_ALL_OBJECTIVES\', payload });\\r\\n \\r\\n const data = (res.data as any).data || [];\\r\\n \\r\\n // 🛑 ENRIQUECIMIENTO (Simulación de estado operativo)\\r\\n // En el futuro, esto vendrá del backend con el estado real de la Torre de Control\\r\\n const enrichedData = data\\r\\n .filter((o: IObjective) => o.location && o.location.latitude)\\r\\n .map((obj: IObjective, index: number) => ({\\r\\n ...obj,\\r\\n status: index % 5 === 0 ? \'alert\' : \'ok\', // Mock de alertas\\r\\n activePersonnel: Math.floor(Math.random() * 4) // Mock de personal\\r\\n }));\\r\\n\\r\\n setAllObjectives(enrichedData);\\r\\n \\r\\n // Recalcular Zoom del Mapa para abarcar todos los puntos\\r\\n if (mapInstance && enrichedData.length > 0) {\\r\\n const bounds = new google.maps.LatLngBounds();\\r\\n enrichedData.forEach((o: IObjective) => bounds.extend({ lat: o.location.latitude, lng: o.location.longitude }));\\r\\n mapInstance.fitBounds(bounds);\\r\\n }\\r\\n\\r\\n // KPIs Rápidos\\r\\n setStats({\\r\\n total: enrichedData.length,\\r\\n alerts: enrichedData.filter((o: any) => o.status === \'alert\').length,\\r\\n active: enrichedData.reduce((acc: number, curr: any) => acc + curr.activePersonnel, 0)\\r\\n });\\r\\n\\r\\n } catch (error) {\\r\\n console.error(\\"Error cargando mapa:\\", error);\\r\\n }\\r\\n };\\r\\n loadObjectives();\\r\\n }, [selectedClientId, mapInstance]);\\r\\n\\r\\n // 2. FILTRADO LOCAL (Buscador)\\r\\n const filteredObjectives = useMemo(() => {\\r\\n return allObjectives.filter(obj => \\r\\n obj.name.toLowerCase().includes(searchQuery.toLowerCase()) ||\\r\\n obj.address.toLowerCase().includes(searchQuery.toLowerCase())\\r\\n );\\r\\n }, [allObjectives, searchQuery]);\\r\\n\\r\\n // 3. HANDLERS\\r\\n const handleSelectObjective = useCallback((obj: IObjectiveMap) => {\\r\\n setSelectedObj(obj);\\r\\n if (mapInstance) {\\r\\n mapInstance.panTo({ lat: obj.location.latitude, lng: obj.location.longitude });\\r\\n mapInstance.setZoom(15);\\r\\n }\\r\\n }, [mapInstance]);\\r\\n\\r\\n const goToControlTower = () => {\\r\\n if (selectedObj) {\\r\\n router.push(`/admin/objective-detail/${selectedObj.id}`);\\r\\n }\\r\\n };\\r\\n\\r\\n return (\\r\\n \\r\\n \\r\\n {/* 1. BARRA DE KPIS (HEADER OPERATIVO) */}\\r\\n
\\r\\n
\\r\\n
\\r\\n

Objetivos Visibles

\\r\\n

{stats.total}

\\r\\n

{selectedClient ? selectedClient.businessName : \'Todas las Empresas\'}

\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
0 ? \'bg-red-50 border-red-200\' : \'bg-white border-slate-200\'}`}>\\r\\n
\\r\\n

0 ? \'text-red-600\' : \'text-slate-500\'}`}>Incidencias Activas

\\r\\n

0 ? \'text-red-700\' : \'text-slate-800\'}`}>{stats.alerts}

\\r\\n

Requieren atención

\\r\\n
\\r\\n
0 ? \'bg-red-100 text-red-600 animate-pulse\' : \'bg-slate-50 text-slate-400\'}`}>\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

Fuerza Activa

\\r\\n

{stats.active}

\\r\\n

Empleados en sitio

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {/* 2. AREA DE TRABAJO (SIDEBAR + MAPA) */}\\r\\n
\\r\\n \\r\\n {/* --- LISTA LATERAL (SIDEBAR) --- */}\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n setSearchQuery(e.target.value)}\\r\\n />\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n {filteredObjectives.length === 0 &&
No se encontraron resultados.
}\\r\\n \\r\\n {filteredObjectives.map(obj => (\\r\\n
handleSelectObjective(obj)}\\r\\n className={`p-3 rounded-lg border cursor-pointer transition-all group ${\\r\\n selectedObj?.id === obj.id \\r\\n ? \'bg-white border-indigo-500 shadow-md ring-1 ring-indigo-50\' \\r\\n : \'bg-white border-slate-200 hover:border-indigo-300 hover:shadow-sm\'\\r\\n }`}\\r\\n >\\r\\n
\\r\\n
\\r\\n

\\r\\n {obj.name}\\r\\n

\\r\\n

\\r\\n {obj.address}\\r\\n

\\r\\n
\\r\\n {/* Semáforo en la lista */}\\r\\n
\\r\\n
\\r\\n {selectedObj?.id === obj.id && (\\r\\n
\\r\\n \\r\\n VER EN MAPA \\r\\n \\r\\n
\\r\\n )}\\r\\n
\\r\\n ))}\\r\\n
\\r\\n
\\r\\n\\r\\n {/* --- MAPA --- */}\\r\\n
\\r\\n {isLoaded ? (\\r\\n setMapInstance(map)}\\r\\n options={mapOptions}\\r\\n >\\r\\n {filteredObjectives.map(obj => (\\r\\n handleSelectObjective(obj)}\\r\\n icon={getMarkerIcon(obj.status)}\\r\\n animation={selectedObj?.id === obj.id ? google.maps.Animation.BOUNCE : undefined}\\r\\n />\\r\\n ))}\\r\\n\\r\\n {/* POPUP DE DETALLE (InfoWindow) */}\\r\\n {selectedObj && (\\r\\n setSelectedObj(null)}\\r\\n options={{ pixelOffset: new google.maps.Size(0, -40) }}\\r\\n >\\r\\n
\\r\\n
\\r\\n

{selectedObj.name}

\\r\\n \\r\\n {selectedObj.status === \'alert\' ? \'INCIDENCIA\' : \'OPERATIVO\'}\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

Personal

\\r\\n

{selectedObj.activePersonnel}

\\r\\n
\\r\\n
\\r\\n

Estado

\\r\\n

Activo

\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n )}\\r\\n \\r\\n ) : (\\r\\n
\\r\\n

Cargando satélite...

\\r\\n
\\r\\n )}\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\nexport default withAuthGuard(OperatorMapPage, [\'admin\', \'manager\', \'operator\', \'supervisor\']);\\n\\n\\n\\n"},{"name":"gantt.tsx","path":"apps/web/pages/admin/planning/gantt.tsx","area":"FRONTEND","folder":"PLANNING","content":"import React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { GanttPlanningView } from \'@/components/admin/planning/GanttPlanningView\';\\r\\n\\r\\nfunction GanttPage() {\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\n// Proteger la ruta\\r\\nexport default withAuthGuard(GanttPage, [\'admin\', \'scheduler\', \'manager\']);\\n\\n\\n\\n"},{"name":"matrix.tsx","path":"apps/web/pages/admin/planning/matrix.tsx","area":"FRONTEND","folder":"PLANNING","content":"import React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\r\\nimport { ObjectiveMatrixView } from \'@/components/admin/planning/ObjectiveMatrixView\';\\r\\n\\r\\nfunction MatrixPage() {\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\nexport default withAuthGuard(MatrixPage, [\'admin\', \'manager\', \'supervisor\']);\\n\\n"},{"name":"objective-coverage.tsx","path":"apps/web/pages/admin/planning/objective-coverage.tsx","area":"FRONTEND","folder":"PLANNING","content":"import React, { useState, useMemo } from \'react\';\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\';\\nimport { useQuery } from \'@tanstack/react-query\';\\nimport { collection, getDocs, Timestamp } from \'firebase/firestore\';\\nimport { db, callManageEmployees } from \'@/services/firebase-client.service\';\\nimport { Calendar } from \'lucide-react\';\\n\\nexport default function MonthlyRosterPage() {\\n const [currentMonth] = useState(new Date());\\n const monthDays = useMemo(() => {\\n const d = new Date(currentMonth.getFullYear(), currentMonth.getMonth(), 1);\\n const days = [];\\n while (d.getMonth() === currentMonth.getMonth()) { days.push(new Date(d)); d.setDate(d.getDate() + 1); }\\n return days;\\n }, [currentMonth]);\\n\\n const { data: employees = [] } = useQuery({ queryKey: [\'roster-emps-final\'], queryFn: async () => {\\n const res: any = await callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: {} });\\n return (res.data as any).data || [];\\n }});\\n\\n const { data: shifts = [] } = useQuery({ queryKey: [\'roster-shifts-real\'], queryFn: async () => {\\n const snap = await getDocs(collection(db, \'turnos\'));\\n return snap.docs.map(d => d.data());\\n }});\\n\\n return (\\n \\n
\\n

{currentMonth.toLocaleDateString(\'es-AR\', { month: \'long\', year: \'numeric\' }).toUpperCase()}

\\n
\\n \\n \\n \\n \\n \\n {monthDays.map(d => )}\\n \\n \\n \\n \\n {employees.map((emp: any) => {\\n let totalHs = 0;\\n const name = (emp.lastName + \', \' + emp.firstName).toUpperCase();\\n return (\\n \\n \\n \\n {monthDays.map(day => {\\n const s = shifts.find((sh: any) => sh.employeeName === name && new Date(sh.startTime instanceof Timestamp ? sh.startTime.toDate() : sh.startTime).toDateString() === day.toDateString());\\n if (s) totalHs += (s.durationHours || 8);\\n return ;\\n })}\\n \\n \\n );\\n })}\\n \\n
LegajoNombre{d.getDate()}Hs
{emp.legajo || \'---\'}{name}{s ? (s.type ? s.type[0] : \'M\') : F}{totalHs}
\\n
\\n
\\n
\\n );\\n}"},{"name":"novedades.tsx","path":"apps/web/pages/admin/rrhh/novedades.tsx","area":"FRONTEND","folder":"RRHH","content":"// Archivo: pages/admin/rrhh/novedades.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\nimport { AbsenceManagementPage } from \'@/components/admin/AbsenceManagementPage\';\\r\\n\\r\\nfunction NovedadesPage() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida (asumo roles de administración y RRHH)\\r\\nexport default withAuthGuard(NovedadesPage, [\'admin\', \'hr_manager\']);\\n\\n\\n\\n"},{"name":"status.tsx","path":"apps/web/pages/admin/status.tsx","area":"FRONTEND","folder":"ADMIN","content":"// Archivo: pages/admin/status.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\nimport { SystemStatus } from \'@/components/admin/SystemStatus\';\\r\\n\\r\\nfunction StatusPage() {\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida (asumo roles de administración)\\r\\nexport default withAuthGuard(StatusPage, [\'admin\']);\\n\\n\\n\\n"},{"name":"system-users.tsx","path":"apps/web/pages/admin/system-users.tsx","area":"FRONTEND","folder":"ADMIN","content":"// Archivo: pages/admin/system-users.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\nimport { SystemUserManagement } from \'@/components/admin/system-user-management\';\\r\\n\\r\\nfunction SystemUsersPage() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida (asumo roles de administración)\\r\\nexport default withAuthGuard(SystemUsersPage, [\'admin\']);\\n\\n\\n\\n"},{"name":"dashboard.tsx","path":"apps/web/pages/employee/dashboard.tsx","area":"FRONTEND","folder":"EMPLOYEE","content":"// Archivo: apps/web/pages/employee/dashboard.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\nimport { EmployeeDashboard } from \'@/components/employee/employee-dashboard\';\\r\\nimport { auth } from \'@/services/firebase-client.service\';\\r\\n\\r\\n// 🛑 FIX: NO usamos DashboardLayout aquí para evitar el sidebar de admin\\r\\n// Si quieres un layout, deberíamos crear uno específico para empleados.\\r\\n// Por ahora, usamos un div simple para limpiar la vista.\\r\\n\\r\\nfunction EmployeePage({ currentUser }: { currentUser: any }) {\\r\\n const router = useRouter(); \\r\\n \\r\\n const handleLogout = async () => {\\r\\n await auth.signOut();\\r\\n window.location.href = \'/\';\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n {/* Header Simple para Empleado */}\\r\\n
\\r\\n
\\r\\n
\\r\\n {/* Logo simple */}\\r\\n \\r\\n
\\r\\n
\\r\\n

Mi Portal

\\r\\n

{currentUser?.email}

\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n {/* Renderizamos el componente de tarjetas nuevo */}\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\nexport default withAuthGuard(EmployeePage, [\'employee\']);\\n\\n\\n\\n"},{"name":"employees.tsx","path":"apps/web/pages/employee/employees.tsx","area":"FRONTEND","folder":"EMPLOYEE","content":"// Archivo: pages/employee/employees.tsx\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\n// Importamos el componente de gestión que ya tienes en src/components\\r\\nimport { EmployeeManagement } from \'@/components/admin/employee-management\';\\r\\n\\r\\nfunction EmployeesPage() {\\r\\n return (\\r\\n \\r\\n {/* Asumo que esta vista permite a los empleados ver la información general */}\\r\\n \\r\\n \\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida (asumo que esta ruta solo es para roles administrativos/HR)\\r\\nexport default withAuthGuard(EmployeesPage, [\'admin\', \'manager\']);\\n\\n\\n\\n"},{"name":"index.tsx","path":"apps/web/pages/index.tsx","area":"FRONTEND","folder":"PAGES","content":"import React, { useEffect } from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { onAuthStateChanged } from \'firebase/auth\';\\r\\nimport { auth } from \'@/services/firebase-client.service\';\\r\\nimport { LoginForm } from \'@/components/admin/login-form\';\\r\\n\\r\\nconst ADMIN_ROLES = [\'admin\', \'SuperAdmin\', \'Scheduler\', \'HR_Manager\'];\\r\\n\\r\\nexport default function HomePage() {\\r\\n const router = useRouter();\\r\\n\\r\\n useEffect(() => {\\r\\n const unsubscribe = onAuthStateChanged(auth, async (user) => {\\r\\n if (user) {\\r\\n try {\\r\\n // Obtenemos el rol real del token\\r\\n const tokenResult = await user.getIdTokenResult();\\r\\n const role = tokenResult.claims.role as string;\\r\\n \\r\\n console.log(\\"Usuario detectado:\\", user.email, \\"| Rol:\\", role);\\r\\n\\r\\n // 🛑 LÓGICA DE BIFURCACIÓN\\r\\n if (ADMIN_ROLES.includes(role)) {\\r\\n console.log(\\"--> Redirigiendo a Admin Dashboard\\");\\r\\n router.push(\'/admin/dashboard\');\\r\\n } else {\\r\\n // Si no es admin, asumimos que es empleado (o \'employee\')\\r\\n console.log(\\"--> Redirigiendo a Employee Dashboard\\");\\r\\n router.push(\'/employee/dashboard\');\\r\\n }\\r\\n } catch (e) {\\r\\n console.error(\\"Error leyendo rol:\\", e);\\r\\n }\\r\\n }\\r\\n });\\r\\n return () => unsubscribe();\\r\\n }, [router]);\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"login.tsx","path":"apps/web/pages/login.tsx","area":"FRONTEND","folder":"PAGES","content":"import React, { useState } from \'react\';\\nimport { useRouter } from \'next/router\';\\nimport { signInWithEmailAndPassword } from \'firebase/auth\';\\nimport { auth } from \'@/services/firebase-client.service\';\\nimport toast from \'react-hot-toast\';\\n\\nexport default function LoginPage() {\\n const [email, setEmail] = useState(\'\');\\n const [password, setPassword] = useState(\'\');\\n const [loading, setLoading] = useState(false);\\n const router = useRouter();\\n\\n const handleLogin = async (e: React.FormEvent) => {\\n e.preventDefault();\\n setLoading(true);\\n try {\\n await signInWithEmailAndPassword(auth, email, password);\\n toast.success(\'Sesión iniciada correctamente\');\\n router.push(\'/admin/home\');\\n } catch (error: any) {\\n console.error(\'Error de login:\', error);\\n toast.error(\'Credenciales incorrectas\');\\n } finally {\\n setLoading(false);\\n }\\n };\\n\\n return (\\n
\\n
\\n
\\n

CRONOAPP

\\n

Ingresa a tu centro de mando

\\n
\\n
\\n
\\n setEmail(e.target.value)}\\n className=\\"w-full px-5 py-4 bg-slate-800 border border-slate-700 text-white rounded-xl focus:ring-2 focus:ring-indigo-500 outline-none transition-all\\"\\n placeholder=\\"Correo electrónico\\"\\n />\\n setPassword(e.target.value)}\\n className=\\"w-full px-5 py-4 bg-slate-800 border border-slate-700 text-white rounded-xl focus:ring-2 focus:ring-indigo-500 outline-none transition-all\\"\\n placeholder=\\"Contraseña\\"\\n />\\n
\\n \\n {loading ? \'Verificando...\' : \'Iniciar Sesión\'}\\n \\n \\n
\\n
\\n );\\n}"},{"name":"_app.tsx","path":"apps/web/pages/_app.tsx","area":"FRONTEND","folder":"PAGES","content":"import React from \'react\';\\r\\nimport type { AppProps } from \'next/app\';\\r\\n// 1. Importamos el sistema de notificaciones (Frontend)\\r\\nimport { Toaster } from \'react-hot-toast\';\\r\\n// 2. Importamos el proveedor de contexto de cliente (Frontend)\\r\\nimport { ClientProvider } from \'@/context/ClientContext\';\\r\\n// 3. Importamos los estilos globales (Tailwind)\\r\\nimport \'@/styles/globals.css\'; \\r\\n\\r\\nexport default function App({ Component, pageProps }: AppProps) {\\r\\n return (\\r\\n // Envolvemos toda la app en el ClientProvider para tener acceso a la empresa seleccionada\\r\\n \\r\\n \\r\\n {/* Renderizamos la página actual */}\\r\\n \\r\\n \\r\\n {/* Configuración global de las notificaciones (Toasts) */}\\r\\n \\r\\n \\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"client.interface.ts","path":"apps/web/src/common/interfaces/client.interface.ts","area":"FRONTEND","folder":"INTERFACES","content":"import { Timestamp } from \'firebase/firestore\';\\r\\nimport { ReactNode } from \'react\';\\r\\n\\r\\nexport interface IClient {\\r\\n id: string;\\r\\n businessName: ReactNode;\\r\\n cuit: ReactNode;\\r\\n contactName: string;\\r\\n contactEmail: ReactNode;\\r\\n name: string;\\r\\n status: \'Active\' | \'Inactive\';\\r\\n createdAt: Timestamp;\\r\\n}\\r\\n\\r\\nexport interface IObjective {\\r\\n id: string;\\r\\n clientId: string;\\r\\n name: string;\\r\\n address: string;\\r\\n location: { latitude: number; longitude: number; };\\r\\n type: string;\\r\\n}\\r\\n\\r\\n// 🛑 CLAVE: IServiceContract con campos operativos\\r\\nexport interface IServiceContract {\\r\\n id: string;\\r\\n objectiveId: string;\\r\\n name: string; \\r\\n totalHoursPerMonth: number;\\r\\n isActive: boolean;\\r\\n startDate: any; \\r\\n endDate?: any;\\r\\n quantity?: number; // Dotación (Personas)\\r\\n daysOfWeek?: number[]; // Días [0-6]\\r\\n}\\r\\n\\r\\nexport interface IShiftType {\\r\\n id: string;\\r\\n contractId: string;\\r\\n name: string; \\r\\n code: string; \\r\\n color: string;\\r\\n startTime: string; \\r\\n durationHours: number; \\r\\n requiredRole?: string;\\r\\n}\\n\\n\\n\\n"},{"name":"employee.interface.ts","path":"apps/web/src/common/interfaces/employee.interface.ts","area":"FRONTEND","folder":"INTERFACES","content":"import { Timestamp } from \'firebase/firestore\'; \\r\\n// NOTA: En el backend (functions) cambia esta línea por: import * as admin from \'firebase-admin\'; y usa admin.firestore.Timestamp\\r\\n\\r\\n/**\\r\\n * @description Define los roles de usuario dentro del sistema.\\r\\n */\\r\\nexport type EmployeeRole = \'admin\' | \'employee\';\\r\\n\\r\\n/**\\r\\n * @description Define los tipos de contrato laboral soportados.\\r\\n */\\r\\nexport type ContractType = \'FullTime\' | \'PartTime\' | \'Eventual\';\\r\\n\\r\\n/**\\r\\n * 🛑 NUEVO: Convenios Colectivos soportados para reglas de negocio.\\r\\n */\\r\\nexport type LaborAgreement = \'SUVICO\' | \'COMERCIO\' | \'UOCRA\' | \'FUERA_CONVENIO\';\\r\\n\\r\\n/**\\r\\n * @description Interfaz principal para la entidad Colaborador (Employee).\\r\\n */\\r\\nexport interface IEmployee {\\r\\n uid: string; // Firebase Auth UID / Document ID\\r\\n name: string;\\r\\n role: EmployeeRole;\\r\\n email: string;\\r\\n \\r\\n // Estado de disponibilidad general\\r\\n isAvailable: boolean;\\r\\n \\r\\n // Configuración Laboral\\r\\n maxHoursPerMonth: number; // Límite de horas contractuales (Soft Block)\\r\\n contractType: ContractType;\\r\\n \\r\\n // 🛑 NUEVO CAMPO: Convenio Colectivo\\r\\n laborAgreement: LaborAgreement; \\r\\n\\r\\n // Campos para el Ciclo de Nómina (RRHH)\\r\\n payrollCycleStartDay?: number; // Día del mes en que comienza el ciclo (Ej: 15)\\r\\n payrollCycleEndDay?: number; // Día del mes en que finaliza el ciclo (Ej: 14)\\r\\n \\r\\n // Ubicación Organizacional\\r\\n clientId?: string; // Cliente asignado actualmente (Opcional)\\r\\n businessUnitId?: string; // Unidad de Negocio\\r\\n\\r\\n // Datos Personales\\r\\n dni: string; \\r\\n fileNumber: string; // Legajo\\r\\n address: string; \\r\\n phone?: string; \\r\\n}\\r\\n\\r\\nexport interface IAbsence {\\r\\n id: string;\\r\\n employeeId: string;\\r\\n employeeName: string;\\r\\n clientId: string;\\r\\n type: \'VACATION\' | \'SICK_LEAVE\' | \'OTHER\';\\r\\n startDate: any; // Timestamp o Date\\r\\n endDate: any; // Timestamp o Date\\r\\n reason: string;\\r\\n status: \'PENDING\' | \'APPROVED\' | \'REJECTED\';\\r\\n createdAt: any;\\r\\n}\\r\\n\\r\\nexport interface IAbsencePayload {\\r\\n employeeId: string;\\r\\n employeeName: string;\\r\\n clientId: string;\\r\\n type: \'VACATION\' | \'SICK_LEAVE\' | \'OTHER\';\\r\\n startDate: Date; \\r\\n endDate: Date;\\r\\n reason: string;\\r\\n}\\n\\n\\n\\n"},{"name":"service-pattern.interface.ts","path":"apps/web/src/common/interfaces/service-pattern.interface.ts","area":"FRONTEND","folder":"INTERFACES","content":"import * as admin from \'firebase-admin\';\\r\\n\\r\\n/**\\r\\n * @interface IServicePattern (El \\"Molde\\" Inteligente)\\r\\n * @description Define una regla de recurrencia para generar turnos automáticamente.\\r\\n * Ej: \\"Necesito 2 Vigiladores (Turno Noche) todos los Lunes, Miércoles y Viernes\\".\\r\\n */\\r\\nexport interface IServicePattern {\\r\\n id: string;\\r\\n contractId: string; // Vinculado al contrato \\"Seguridad Planta 2025\\"\\r\\n shiftTypeId: string; // Usa la modalidad \\"Turno Noche 12hs\\"\\r\\n \\r\\n // Configuración de Recurrencia\\r\\n // 0=Dom, 1=Lun, ..., 6=Sab. Ej: [1,2,3,4,5] para Lun-Vie.\\r\\n daysOfWeek: number[]; \\r\\n \\r\\n // Cantidad de recursos requeridos simultáneamente\\r\\n quantityPerDay: number; \\r\\n \\r\\n // Vigencia de la regla\\r\\n validFrom: admin.firestore.Timestamp;\\r\\n validTo?: admin.firestore.Timestamp; // Si es null, es indefinido\\r\\n \\r\\n // Metadatos\\r\\n createdAt: admin.firestore.Timestamp;\\r\\n createdBy: string; // UID del planificador\\r\\n active: boolean;\\r\\n}\\r\\n\\r\\n/**\\r\\n * Payload para crear/editar un patrón desde el Frontend\\r\\n */\\r\\nexport interface IPatternPayload {\\r\\n contractId: string;\\r\\n shiftTypeId: string;\\r\\n daysOfWeek: number[];\\r\\n quantity: number;\\r\\n validFrom: string; // ISO String\\r\\n validTo?: string; // ISO String\\r\\n}\\n\\n\\n\\n"},{"name":"shift.interface.ts","path":"apps/web/src/common/interfaces/shift.interface.ts","area":"FRONTEND","folder":"INTERFACES","content":"import { Timestamp } from \'firebase/firestore\';\\r\\n\\r\\n/**\\r\\n * @file shift.interface.ts\\r\\n * @description Definición de la estructura de un Turno (Shift) compartido entre Frontend y Backend.\\r\\n */\\r\\n\\r\\n// Definimos un tipo flexible para las fechas para soportar:\\r\\n// 1. admin.firestore.Timestamp (Backend)\\r\\n// 2. firebase.firestore.Timestamp (Frontend SDK)\\r\\n// 3. Date (Objetos JS nativos tras conversión)\\r\\n// 4. { seconds: number, nanoseconds: number } (JSON serializado)\\r\\nexport type FirestoreDate = any;\\r\\n\\r\\nexport type ShiftStatus = \'Assigned\' | \'Confirmed\' | \'InProgress\' | \'Completed\' | \'Canceled\';\\r\\n\\r\\nexport interface IShift {\\r\\n id: string; // ID del documento en Firestore\\r\\n \\r\\n // Relación con Empleado\\r\\n employeeId: string;\\r\\n employeeName: string;\\r\\n \\r\\n // Relación con Objetivo (Cliente/Sede)\\r\\n objectiveId: string;\\r\\n objectiveName: string;\\r\\n \\r\\n // Tiempos\\r\\n startTime: FirestoreDate;\\r\\n endTime: FirestoreDate;\\r\\n \\r\\n // Estado del ciclo de vida\\r\\n status: ShiftStatus;\\r\\n\\r\\n // Datos opcionales de auditoría en el mismo documento (si aplica)\\r\\n checkInTime?: FirestoreDate;\\r\\n checkOutTime?: FirestoreDate;\\r\\n\\r\\n // Metadatos\\r\\n schedulerId: string;\\r\\n updatedAt: FirestoreDate;\\r\\n\\r\\n // Roles y Flags Visuales\\r\\n role?: string; // Ej: \'Vigilador\'\\r\\n isOvertime?: boolean; // 🛑 NUEVO: Indica si el turno excede horas (Visualización Ámbar)\\r\\n}\\n\\n\\n\\n"},{"name":"system-user.interface.ts","path":"apps/web/src/common/interfaces/system-user.interface.ts","area":"FRONTEND","folder":"INTERFACES","content":"import { Timestamp } from \'firebase/firestore\'; // 🛑 SDK CLIENTE (Importante para la Web)\\r\\n\\r\\n/**\\r\\n * Roles Jerárquicos del Sistema (RBAC):\\r\\n * - SuperAdmin: IT / Dueño del SaaS. Acceso total.\\r\\n * - Manager: Gerente de Unidad. Ve todo dentro de su unidad.\\r\\n * - Scheduler: Planificador. Gestiona turnos y asignaciones.\\r\\n * - Supervisor: Campo. Gestiona incidencias y personal.\\r\\n * - Operator: Monitoreo. Solo lectura o vista de tablero en vivo.\\r\\n */\\r\\nexport type SystemRole = \\r\\n | \'SuperAdmin\' \\r\\n | \'Manager\' \\r\\n | \'Scheduler\' \\r\\n | \'Supervisor\' \\r\\n | \'Operator\';\\r\\n\\r\\n/**\\r\\n * Interfaz de Usuario del Sistema (Frontend).\\r\\n * Define la estructura de los administradores que acceden al Back-Office.\\r\\n */\\r\\nexport interface ISystemUser {\\r\\n uid: string;\\r\\n email: string;\\r\\n displayName: string;\\r\\n role: SystemRole;\\r\\n \\r\\n // ID de la Unidad de Negocio a la que pertenece\\r\\n // Si es undefined y el rol es SuperAdmin, tiene acceso global.\\r\\n businessUnitId?: string; \\r\\n \\r\\n status: \'Active\' | \'Inactive\';\\r\\n \\r\\n // Fechas usando el tipo compatible con el SDK de Cliente\\r\\n createdAt: Timestamp;\\r\\n lastLogin?: Timestamp;\\r\\n}\\n\\n\\n\\n"},{"name":"labor-agreement.interface.ts","path":"apps/web/src/common/labor-agreement.interface.ts","area":"FRONTEND","folder":"COMMON","content":"import { Timestamp } from \'firebase/firestore\'; \\r\\n// En backend: import * as admin from \'firebase-admin\';\\r\\n\\r\\nexport interface ILaborAgreement {\\r\\n id: string;\\r\\n code: string; // Ej: \'SUVICO\', \'UOCRA\'\\r\\n name: string; // Ej: \'Seguridad Privada 422/05\'\\r\\n \\r\\n // Reglas de Negocio (Lo que antes estaba fijo en código)\\r\\n maxHoursWeekly: number; // 48\\r\\n maxHoursMonthly: number; // 204\\r\\n overtimeThresholdDaily: number; // 12\\r\\n \\r\\n // Configuración de Extras\\r\\n saturdayCutoffHour: number; // 13 (Sábado Inglés)\\r\\n nightShiftStart: number; // 21\\r\\n nightShiftEnd: number; // 6\\r\\n \\r\\n isActive: boolean;\\r\\n createdAt?: any;\\r\\n}\\r\\n\\n\\n\\n\\n"},{"name":"AbsenceManagementPage.tsx","path":"apps/web/src/components/admin/AbsenceManagementPage.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { useClient } from \'@/context/ClientContext\';\\r\\nimport { IAbsencePayload, IEmployee } from \'@/common/interfaces/employee.interface\';\\r\\nimport { createAbsence, callManageEmployees } from \'@/services/firebase-client.service\';\\r\\nimport InputField from \'@/components/common/InputField\'; \\r\\nimport SelectField from \'@/components/common/SelectField\';\\r\\nimport Button from \'@/components/common/Button\';\\r\\n\\r\\nconst ABSENCE_TYPES = [\\r\\n { value: \'VACATION\', label: \'Vacaciones\' },\\r\\n { value: \'SICK_LEAVE\', label: \'Licencia Médica\' },\\r\\n { value: \'OTHER\', label: \'Otro / Personal\' },\\r\\n];\\r\\n\\r\\nexport function AbsenceManagementPage() {\\r\\n const { selectedClientId, selectedClient } = useClient();\\r\\n const [employees, setEmployees] = useState([]);\\r\\n const [isLoadingEmployees, setIsLoadingEmployees] = useState(false);\\r\\n const [isSubmitting, setIsSubmitting] = useState(false);\\r\\n\\r\\n // Estado inicial del formulario\\r\\n const [formData, setFormData] = useState({\\r\\n employeeId: \'\',\\r\\n employeeName: \'\',\\r\\n clientId: selectedClientId || \'\',\\r\\n type: \'VACATION\',\\r\\n startDate: new Date(),\\r\\n endDate: new Date(),\\r\\n reason: \'\',\\r\\n });\\r\\n\\r\\n // Sincronizar clientId cuando cambia la selección en el menú\\r\\n useEffect(() => {\\r\\n setFormData(prev => ({ \\r\\n ...prev, \\r\\n clientId: selectedClientId || \'\', \\r\\n employeeId: \'\', \\r\\n employeeName: \'\' \\r\\n }));\\r\\n }, [selectedClientId]);\\r\\n\\r\\n // Cargar Empleados (Filtrados por Empresa)\\r\\n useEffect(() => {\\r\\n const fetchEmployees = async () => {\\r\\n if (!selectedClientId) {\\r\\n setEmployees([]);\\r\\n return;\\r\\n }\\r\\n\\r\\n setIsLoadingEmployees(true);\\r\\n try {\\r\\n const empRes = await callManageEmployees({ \\r\\n action: \'GET_ALL_EMPLOYEES\', \\r\\n payload: { clientId: selectedClientId } \\r\\n });\\r\\n \\r\\n setEmployees((empRes.data as any).data || []); \\r\\n } catch (error) {\\r\\n console.error(\\"Error fetching employees:\\", error);\\r\\n toast.error(\\"No se pudo cargar la lista de empleados.\\");\\r\\n } finally {\\r\\n setIsLoadingEmployees(false);\\r\\n }\\r\\n };\\r\\n fetchEmployees();\\r\\n }, [selectedClientId]);\\r\\n\\r\\n const handleEmployeeChange = (e: React.ChangeEvent) => {\\r\\n const selectedId = e.target.value;\\r\\n const selectedEmployee = employees.find(emp => emp.uid === selectedId);\\r\\n\\r\\n setFormData(prev => ({\\r\\n ...prev,\\r\\n employeeId: selectedId,\\r\\n employeeName: selectedEmployee ? selectedEmployee.name : \'\'\\r\\n }));\\r\\n };\\r\\n\\r\\n const handleDateChange = (name: keyof IAbsencePayload, value: string) => {\\r\\n // 🛑 FIX CRÍTICO DE FECHAS:\\r\\n // Al crear la fecha desde el string YYYY-MM-DD del input, agregamos T12:00:00.\\r\\n // Esto evita que, por diferencias de zona horaria (UTC-3), la fecha \\"retroceda\\" un día\\r\\n // al guardarse. El backend luego forzará 00:00 y 23:59.\\r\\n const dateValue = new Date(value + \'T12:00:00\'); \\r\\n \\r\\n setFormData(prev => ({\\r\\n ...prev,\\r\\n [name]: dateValue,\\r\\n }));\\r\\n };\\r\\n\\r\\n const validateForm = (data: IAbsencePayload): boolean => {\\r\\n if (!data.employeeId || !data.clientId || !data.type) {\\r\\n toast.error(\\"Complete los campos obligatorios (Empleado, Tipo).\\");\\r\\n return false;\\r\\n }\\r\\n if (data.startDate.getTime() > data.endDate.getTime()) {\\r\\n toast.error(\\"La fecha de inicio no puede ser posterior a la de fin.\\");\\r\\n return false;\\r\\n }\\r\\n if (!data.reason.trim()) {\\r\\n toast.error(\\"Debe proporcionar una razón o comentario.\\");\\r\\n return false;\\r\\n }\\r\\n return true;\\r\\n };\\r\\n\\r\\n const handleSubmit = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n if (!validateForm(formData)) return;\\r\\n\\r\\n setIsSubmitting(true);\\r\\n const toastId = toast.loading(`Registrando ${formData.type}...`);\\r\\n\\r\\n try {\\r\\n // Enviamos al servicio (que llama a la Cloud Function)\\r\\n // El backend se encarga de verificar conflictos y generar vacantes si es necesario\\r\\n const res = await createAbsence({ action: \'CREATE_ABSENCE\', payload: formData });\\r\\n \\r\\n // Feedback Inteligente: Avisamos si hubo impacto operativo\\r\\n if (res.impactedShiftsCount && res.impactedShiftsCount > 0) {\\r\\n toast.success(\\r\\n `Novedad registrada.\\\\n⚠️ Se liberaron ${res.impactedShiftsCount} turnos que ahora son VACANTES.`,\\r\\n { id: toastId, duration: 6000, icon: \'⚠️\' }\\r\\n );\\r\\n } else {\\r\\n toast.success(\\"Novedad registrada exitosamente.\\", { id: toastId });\\r\\n }\\r\\n \\r\\n // Reset del formulario (mantenemos fechas hoy para agilidad)\\r\\n setFormData(prev => ({ \\r\\n ...prev, \\r\\n type: \'VACATION\', \\r\\n startDate: new Date(), \\r\\n endDate: new Date(), \\r\\n reason: \'\' \\r\\n }));\\r\\n\\r\\n } catch (error: any) {\\r\\n console.error(\\"Absence creation failed:\\", error);\\r\\n const message = error.message.includes(\'Conflicto\') || error.message.includes(\'BLOQUEO\')\\r\\n ? error.message \\r\\n : \\"Error al registrar la novedad. Intente nuevamente.\\";\\r\\n toast.error(message, { id: toastId, duration: 5000 });\\r\\n } finally {\\r\\n setIsSubmitting(false);\\r\\n }\\r\\n };\\r\\n\\r\\n if (!selectedClientId) {\\r\\n return (\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n

Selección Requerida

\\r\\n

Por favor, seleccione una empresa en el menú lateral para gestionar las novedades de su personal.

\\r\\n
\\r\\n );\\r\\n }\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n
\\r\\n

Gestión de Novedades

\\r\\n

Registrar licencias y vacaciones para {selectedClient?.businessName}.

\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n {employees.map(emp => (\\r\\n \\r\\n ))}\\r\\n \\r\\n\\r\\n setFormData(prev => ({ ...prev, type: e.target.value as IAbsencePayload[\'type\'] }))}\\r\\n disabled={isSubmitting}\\r\\n required\\r\\n >\\r\\n {ABSENCE_TYPES.map(type => (\\r\\n \\r\\n ))}\\r\\n \\r\\n\\r\\n
\\r\\n handleDateChange(\'startDate\', e.target.value)}\\r\\n disabled={isSubmitting}\\r\\n required\\r\\n />\\r\\n handleDateChange(\'endDate\', e.target.value)}\\r\\n disabled={isSubmitting}\\r\\n required\\r\\n />\\r\\n
\\r\\n\\r\\n setFormData(prev => ({ ...prev, reason: e.target.value }))}\\r\\n rows={3}\\r\\n disabled={isSubmitting}\\r\\n required\\r\\n placeholder=\\"Detalle el motivo de la ausencia...\\"\\r\\n />\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"client-management.tsx","path":"apps/web/src/components/admin/client-management.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { callManageHierarchy } from \'@/services/firebase-client.service\';\\r\\nimport { IClient } from \'@/common/interfaces/client.interface\';\\r\\nimport InputField from \'@/components/common/InputField\';\\r\\nimport SelectField from \'@/components/common/SelectField\';\\r\\nimport Button from \'@/components/common/Button\';\\r\\nimport { useClient } from \'@/context/ClientContext\'; // Para recargar el contexto global al cambiar algo\\r\\n\\r\\nexport function ClientManagement() {\\r\\n const { setClient } = useClient(); // Usamos esto para forzar recarga si es necesario\\r\\n const [clients, setClients] = useState([]);\\r\\n const [loading, setLoading] = useState(true);\\r\\n const [showModal, setShowModal] = useState(false);\\r\\n const [isEditing, setIsEditing] = useState(false);\\r\\n const [isSubmitting, setIsSubmitting] = useState(false);\\r\\n\\r\\n // Estado del Formulario\\r\\n const [formData, setFormData] = useState({\\r\\n id: \'\',\\r\\n businessName: \'\',\\r\\n cuit: \'\',\\r\\n contactName: \'\',\\r\\n contactEmail: \'\',\\r\\n status: \'Active\' as \'Active\' | \'Inactive\'\\r\\n });\\r\\n\\r\\n // 1. Cargar Clientes\\r\\n const fetchClients = async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const res = await callManageHierarchy({ action: \'GET_ALL_CLIENTS\', payload: {} });\\r\\n const data = (res.data as any).data || [];\\r\\n setClients(data);\\r\\n } catch (error) {\\r\\n console.error(error);\\r\\n toast.error(\\"Error al cargar la cartera de clientes.\\");\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n useEffect(() => {\\r\\n fetchClients();\\r\\n }, []);\\r\\n\\r\\n // 2. Manejadores del Modal\\r\\n const handleOpenCreate = () => {\\r\\n setFormData({ id: \'\', businessName: \'\', cuit: \'\', contactName: \'\', contactEmail: \'\', status: \'Active\' });\\r\\n setIsEditing(false);\\r\\n setShowModal(true);\\r\\n };\\r\\n\\r\\n const handleOpenEdit = (client: IClient) => {\\r\\n setFormData({\\r\\n id: client.id,\\r\\n businessName: String(client.businessName),\\r\\n cuit: String(client.cuit),\\r\\n contactName: client.contactName || \'\',\\r\\n contactEmail: String(client.contactEmail || \'\'),\\r\\n status: client.status\\r\\n });\\r\\n setIsEditing(true);\\r\\n setShowModal(true);\\r\\n };\\r\\n\\r\\n // 3. Guardar (Crear o Editar)\\r\\n const handleSave = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setIsSubmitting(true);\\r\\n const toastId = toast.loading(isEditing ? \\"Actualizando...\\" : \\"Creando empresa...\\");\\r\\n\\r\\n try {\\r\\n if (isEditing) {\\r\\n // UPDATE\\r\\n await callManageHierarchy({ \\r\\n action: \'UPDATE_CLIENT\', \\r\\n payload: { \\r\\n id: formData.id, \\r\\n data: {\\r\\n businessName: formData.businessName,\\r\\n cuit: formData.cuit,\\r\\n contactName: formData.contactName,\\r\\n contactEmail: formData.contactEmail,\\r\\n status: formData.status\\r\\n }\\r\\n } \\r\\n });\\r\\n toast.success(\\"Empresa actualizada\\", { id: toastId });\\r\\n } else {\\r\\n // CREATE\\r\\n await callManageHierarchy({ \\r\\n action: \'CREATE_CLIENT\', \\r\\n payload: {\\r\\n businessName: formData.businessName,\\r\\n cuit: formData.cuit,\\r\\n contactName: formData.contactName,\\r\\n contactEmail: formData.contactEmail,\\r\\n status: formData.status\\r\\n }\\r\\n });\\r\\n toast.success(\\"Empresa creada exitosamente\\", { id: toastId });\\r\\n }\\r\\n \\r\\n setShowModal(false);\\r\\n fetchClients(); // Recargar lista local\\r\\n // Opcional: Recargar contexto global si fuera necesario\\r\\n // setClient(\'\'); \\r\\n\\r\\n } catch (error: any) {\\r\\n console.error(error);\\r\\n toast.error(`Error: ${error.message}`, { id: toastId });\\r\\n } finally {\\r\\n setIsSubmitting(false);\\r\\n }\\r\\n };\\r\\n\\r\\n // 4. Eliminar\\r\\n const handleDelete = async (id: string, name: string) => {\\r\\n if (!confirm(`¿Estás seguro de eliminar a ${name}? Esto podría romper datos históricos.`)) return;\\r\\n \\r\\n const toastId = toast.loading(\\"Eliminando...\\");\\r\\n try {\\r\\n await callManageHierarchy({ action: \'DELETE_CLIENT\', payload: { id } });\\r\\n toast.success(\\"Empresa eliminada\\", { id: toastId });\\r\\n fetchClients();\\r\\n } catch (error: any) {\\r\\n toast.error(`Error: ${error.message}`, { id: toastId });\\r\\n }\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n {/* Header de Sección */}\\r\\n
\\r\\n
\\r\\n

Cartera de Clientes

\\r\\n

Gestione las empresas contratantes.

\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n {/* Tabla Responsiva */}\\r\\n
\\r\\n {loading ? (\\r\\n
Cargando cartera...
\\r\\n ) : (\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {clients.length === 0 && (\\r\\n \\r\\n )}\\r\\n {clients.map((client) => (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n ))}\\r\\n \\r\\n
Razón SocialCUIT / IDContactoEstadoAcciones
No hay clientes registrados.
\\r\\n
\\r\\n
\\r\\n {String(client.businessName).charAt(0)}\\r\\n
\\r\\n
{client.businessName}
\\r\\n
\\r\\n
\\r\\n {client.cuit}
\\r\\n {client.id.substring(0,8)}...\\r\\n
\\r\\n
{client.contactName}
\\r\\n
{client.contactEmail}
\\r\\n
\\r\\n \\r\\n {client.status === \'Active\' ? \'Activo\' : \'Inactivo\'}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n\\r\\n {/* Modal CRUD */}\\r\\n {showModal && (\\r\\n
\\r\\n
\\r\\n
\\r\\n

{isEditing ? \'Editar Empresa\' : \'Nueva Empresa\'}

\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n setFormData({...formData, businessName: e.target.value})} \\r\\n placeholder=\\"Ej: Seguridad Integral S.A.\\"\\r\\n required \\r\\n />\\r\\n \\r\\n
\\r\\n setFormData({...formData, cuit: e.target.value})} \\r\\n placeholder=\\"30-12345678-9\\"\\r\\n required \\r\\n />\\r\\n setFormData({...formData, status: e.target.value as any})}\\r\\n >\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n

Datos de Contacto

\\r\\n
\\r\\n setFormData({...formData, contactName: e.target.value})} \\r\\n placeholder=\\"Ej: Juan Gerente\\"\\r\\n />\\r\\n setFormData({...formData, contactEmail: e.target.value})} \\r\\n placeholder=\\"contacto@empresa.com\\"\\r\\n />\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"client-setup-wizard.tsx","path":"apps/web/src/components/admin/client-setup-wizard.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { callManageHierarchy, createPattern } from \'@/services/firebase-client.service\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { \\r\\n Building2, MapPin, FileText, Clock, CheckCircle2, \\r\\n ArrowRight, Plus, Calendar, Calculator, AlertTriangle\\r\\n} from \'lucide-react\';\\r\\n\\r\\ninterface ShiftTypeUI {\\r\\n name: string;\\r\\n code: string;\\r\\n startTime: string;\\r\\n durationHours: number;\\r\\n}\\r\\n\\r\\nexport function ClientSetupWizard() {\\r\\n const router = useRouter();\\r\\n const [step, setStep] = useState(1);\\r\\n const [loading, setLoading] = useState(false);\\r\\n \\r\\n const [ids, setIds] = useState({ clientId: \'\', objectiveId: \'\', contractId: \'\' });\\r\\n const [addedShifts, setAddedShifts] = useState([]);\\r\\n\\r\\n // STATES\\r\\n const [clientData, setClientData] = useState({ businessName: \'\', cuit: \'\', contactName: \'\', contactEmail: \'\' });\\r\\n const [objData, setObjData] = useState({ name: \'\', address: \'\', latitude: \'\', longitude: \'\' });\\r\\n \\r\\n // 🛑 FIX: Estado extendido para el contrato (Días y Fechas)\\r\\n const [contractData, setContractData] = useState({ \\r\\n name: \'\', \\r\\n totalHoursPerMonth: 720,\\r\\n startDate: new Date().toISOString().split(\'T\')[0], // Default Hoy YYYY-MM-DD\\r\\n endDate: \'\',\\r\\n daysOfWeek: [1, 2, 3, 4, 5] // Default Lunes a Viernes\\r\\n });\\r\\n \\r\\n const [shiftData, setShiftData] = useState({ \\r\\n name: \'Turno Mañana\', \\r\\n code: \'TM\', \\r\\n startTime: \'06:00\', \\r\\n durationHours: 8 \\r\\n });\\r\\n\\r\\n // --- CALCULADORA EN TIEMPO REAL ---\\r\\n const [metrics, setMetrics] = useState({ totalVacancies: 0, totalHours: 0 });\\r\\n\\r\\n useEffect(() => {\\r\\n // Calculamos proyección solo si hay fechas y turnos\\r\\n if (!contractData.startDate || addedShifts.length === 0) return;\\r\\n \\r\\n const start = new Date(contractData.startDate);\\r\\n // Si hay fecha fin la usamos, sino proyectamos a fin de mes de la fecha de inicio\\r\\n const end = contractData.endDate \\r\\n ? new Date(contractData.endDate) \\r\\n : new Date(start.getFullYear(), start.getMonth() + 1, 0);\\r\\n\\r\\n let workingDaysCount = 0;\\r\\n \\r\\n // Iterar días para contar hábiles según configuración\\r\\n for (let d = new Date(start); d <= end; d.setDate(d.getDate() + 1)) {\\r\\n // getDay(): 0=Dom, 1=Lun...\\r\\n if (contractData.daysOfWeek.includes(d.getDay())) {\\r\\n workingDaysCount++;\\r\\n }\\r\\n }\\r\\n\\r\\n // Total Turnos Diarios (Suma de todas las modalidades)\\r\\n // Asumimos 1 persona por modalidad (si fueran más, habría que agregar campo \'quantity\' al shiftData)\\r\\n const shiftsPerDay = addedShifts.length; \\r\\n const totalHoursPerDay = addedShifts.reduce((acc, curr) => acc + curr.durationHours, 0);\\r\\n\\r\\n setMetrics({\\r\\n totalVacancies: workingDaysCount * shiftsPerDay,\\r\\n totalHours: workingDaysCount * totalHoursPerDay\\r\\n });\\r\\n\\r\\n }, [contractData, addedShifts]);\\r\\n\\r\\n // --- HANDLERS ---\\r\\n\\r\\n const handleCreateClient = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setLoading(true);\\r\\n try {\\r\\n const res = await callManageHierarchy({ action: \'CREATE_CLIENT\', payload: { ...clientData, status: \'Active\' } });\\r\\n const data = res.data as any;\\r\\n setIds(prev => ({ ...prev, clientId: data.data.id }));\\r\\n toast.success(\\"Empresa registrada\\");\\r\\n setStep(2);\\r\\n } catch (error: any) { toast.error(error.message); } \\r\\n finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n const handleCreateObjective = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setLoading(true);\\r\\n try {\\r\\n const payload = {\\r\\n ...objData,\\r\\n clientId: ids.clientId,\\r\\n location: { latitude: Number(objData.latitude), longitude: Number(objData.longitude) },\\r\\n type: \'Sede\'\\r\\n };\\r\\n const res = await callManageHierarchy({ action: \'CREATE_OBJECTIVE\', payload });\\r\\n const data = res.data as any;\\r\\n setIds(prev => ({ ...prev, objectiveId: data.data.id }));\\r\\n toast.success(\\"Sede creada\\");\\r\\n setStep(3);\\r\\n } catch (error: any) { toast.error(error.message); } \\r\\n finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n // 🛑 PASO 3 CORREGIDO: Envía fechas y días reales\\r\\n const handleCreateContract = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setLoading(true);\\r\\n try {\\r\\n const payload = {\\r\\n objectiveId: ids.objectiveId,\\r\\n name: contractData.name,\\r\\n totalHoursPerMonth: contractData.totalHoursPerMonth,\\r\\n startDate: new Date(contractData.startDate).toISOString(),\\r\\n endDate: contractData.endDate ? new Date(contractData.endDate).toISOString() : undefined,\\r\\n daysOfWeek: contractData.daysOfWeek, // Enviamos el array elegido\\r\\n quantity: 1, // Dotación base por turno (simplificado)\\r\\n isActive: true\\r\\n };\\r\\n \\r\\n const res = await callManageHierarchy({ action: \'CREATE_CONTRACT\', payload });\\r\\n const data = res.data as any;\\r\\n setIds(prev => ({ ...prev, contractId: data.data.id }));\\r\\n \\r\\n toast.success(\\"Contrato configurado\\");\\r\\n setStep(4);\\r\\n } catch (error: any) { toast.error(error.message); } \\r\\n finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n const handleCreateShiftType = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setLoading(true);\\r\\n try {\\r\\n // 1. Crear Tipo de Turno\\r\\n const payload = { ...shiftData, contractId: ids.contractId, color: \'#3B82F6\' };\\r\\n const resShift = await callManageHierarchy({ action: \'CREATE_SHIFT_TYPE\', payload });\\r\\n const shiftTypeData = (resShift.data as any).data;\\r\\n\\r\\n // 2. 🛑 Crear Patrón Automático usando la configuración del contrato (Paso 3)\\r\\n await createPattern({\\r\\n contractId: ids.contractId,\\r\\n shiftTypeId: shiftTypeData.id,\\r\\n daysOfWeek: contractData.daysOfWeek, // Usamos los días elegidos en Paso 3\\r\\n quantity: 1, \\r\\n validFrom: new Date(contractData.startDate).toISOString(), // Fecha inicio real\\r\\n validTo: contractData.endDate ? new Date(contractData.endDate).toISOString() : undefined\\r\\n });\\r\\n \\r\\n toast.success(\\"Modalidad y Regla agregadas\\");\\r\\n setAddedShifts(prev => [...prev, shiftData]);\\r\\n \\r\\n // Reset form sugerido\\r\\n let nextTime = \'06:00\';\\r\\n if (shiftData.startTime === \'06:00\') nextTime = \'14:00\';\\r\\n if (shiftData.startTime === \'14:00\') nextTime = \'22:00\';\\r\\n\\r\\n setShiftData({ \\r\\n name: \'\', \\r\\n code: \'\', \\r\\n startTime: nextTime, \\r\\n durationHours: 8 \\r\\n });\\r\\n\\r\\n } catch (error: any) { toast.error(error.message); } \\r\\n finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n const handleFinish = () => {\\r\\n toast.success(\\"¡Configuración lista!\\");\\r\\n router.push(\'/admin/dashboard\');\\r\\n };\\r\\n\\r\\n // Helper para toggle de días\\r\\n const toggleDay = (dayIndex: number) => {\\r\\n setContractData(prev => {\\r\\n const exists = prev.daysOfWeek.includes(dayIndex);\\r\\n const newDays = exists \\r\\n ? prev.daysOfWeek.filter(d => d !== dayIndex)\\r\\n : [...prev.daysOfWeek, dayIndex].sort();\\r\\n return { ...prev, daysOfWeek: newDays };\\r\\n });\\r\\n };\\r\\n\\r\\n const inputClass = \\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 py-2.5 px-3 border mt-1 text-sm\\";\\r\\n const labelClass = \\"block text-xs font-bold text-gray-500 uppercase tracking-wide mb-1\\";\\r\\n const btnClass = \\"w-full bg-indigo-600 text-white py-3 rounded-lg hover:bg-indigo-700 transition font-bold shadow-md flex justify-center items-center gap-2 disabled:opacity-50\\";\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n {[\'Empresa\', \'Sede\', \'Contrato\', \'Turnos\'].map((label, i) => {\\r\\n const num = i + 1;\\r\\n return (\\r\\n
\\r\\n
= num ? \'bg-indigo-600 border-indigo-600 text-white\' : \'border-slate-200 text-slate-300\'}`}>\\r\\n {step > num ? : num}\\r\\n
\\r\\n {label}\\r\\n
\\r\\n )\\r\\n })}\\r\\n
\\r\\n\\r\\n
\\r\\n {step === 1 && (\\r\\n
\\r\\n

Datos de la Empresa

\\r\\n
setClientData({...clientData, businessName: e.target.value})} required autoFocus />
\\r\\n
setClientData({...clientData, cuit: e.target.value})} required />
\\r\\n \\r\\n
\\r\\n )}\\r\\n\\r\\n {step === 2 && (\\r\\n
\\r\\n

Ubicación del Servicio

\\r\\n
setObjData({...objData, name: e.target.value})} required />
\\r\\n
setObjData({...objData, address: e.target.value})} required />
\\r\\n
\\r\\n
setObjData({...objData, latitude: e.target.value})} step=\\"any\\" required/>
\\r\\n
setObjData({...objData, longitude: e.target.value})} step=\\"any\\" required/>
\\r\\n
\\r\\n \\r\\n
\\r\\n )}\\r\\n\\r\\n {/* 🛑 PASO 3: CONFIGURACIÓN CRÍTICA DE FECHAS Y DÍAS */}\\r\\n {step === 3 && (\\r\\n
\\r\\n

Definición del Acuerdo

\\r\\n \\r\\n
\\r\\n
setContractData({...contractData, name: e.target.value})} required />
\\r\\n
setContractData({...contractData, totalHoursPerMonth: +e.target.value})} required />
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n Vigencia y Cobertura\\r\\n
\\r\\n
\\r\\n
setContractData({...contractData, startDate: e.target.value})} required />
\\r\\n
setContractData({...contractData, endDate: e.target.value})} />
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n {[\'D\',\'L\',\'M\',\'M\',\'J\',\'V\',\'S\'].map((day, i) => (\\r\\n \\r\\n ))}\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n )}\\r\\n\\r\\n {step === 4 && (\\r\\n
\\r\\n \\r\\n {/* 🛑 CALCULADORA PREDICTIVA */}\\r\\n
\\r\\n
\\r\\n
\\r\\n

Proyección Mensual

\\r\\n
\\r\\n contractData.totalHoursPerMonth ? \'text-red-400\' : \'text-emerald-400\'}`}>\\r\\n {metrics.totalHours} hs\\r\\n \\r\\n / {contractData.totalHoursPerMonth} hs\\r\\n
\\r\\n

\\r\\n {metrics.totalVacancies} Vacantes totales ({addedShifts.length} turnos x {metrics.totalVacancies / (addedShifts.length || 1)} días)\\r\\n

\\r\\n
\\r\\n {metrics.totalHours > contractData.totalHoursPerMonth && (\\r\\n
\\r\\n \\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n

Agregar Modalidad

\\r\\n
\\r\\n setShiftData({...shiftData, name: e.target.value})} placeholder=\\"Nombre (ej: Mañana)\\" />\\r\\n setShiftData({...shiftData, code: e.target.value})} placeholder=\\"Código (ej: TM)\\" />\\r\\n setShiftData({...shiftData, startTime: e.target.value})} />\\r\\n setShiftData({...shiftData, durationHours: +e.target.value})} placeholder=\\"Horas\\" />\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n {addedShifts.length > 0 && (\\r\\n
\\r\\n {addedShifts.map((shift, i) => (\\r\\n
\\r\\n {shift.name}\\r\\n {shift.startTime} ({shift.durationHours}h)\\r\\n
\\r\\n ))}\\r\\n
\\r\\n )}\\r\\n \\r\\n \\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"employee-management.tsx","path":"apps/web/src/components/admin/employee-management.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect, useRef } from \'react\';\\r\\nimport { callManageEmployees, callCreateUser } from \'@/services/firebase-client.service\';\\r\\nimport { IEmployee, LaborAgreement } from \'@/common/interfaces/employee.interface\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { useClient } from \'@/context/ClientContext\'; \\r\\nimport InputField from \'@/components/common/InputField\';\\r\\nimport SelectField from \'@/components/common/SelectField\';\\r\\nimport Button from \'@/components/common/Button\'; \\r\\nimport { Clock, AlertTriangle, Edit2, Trash2, Briefcase, FileText, Upload, Download, FileSpreadsheet, PieChart } from \'lucide-react\';\\r\\n\\r\\ninterface WorkloadReport {\\r\\n assignedHours: number;\\r\\n completedHours: number;\\r\\n maxHours: number;\\r\\n cycleStart: string;\\r\\n cycleEnd: string;\\r\\n details: Array<{ shiftId: string, objectiveName: string, duration: number, status: string, date: string, startTime: string }>;\\r\\n}\\r\\n\\r\\nexport function EmployeeManagement() {\\r\\n const { clients, selectedClientId } = useClient();\\r\\n const [employees, setEmployees] = useState([]);\\r\\n const [loading, setLoading] = useState(true);\\r\\n \\r\\n // Estados de Modales\\r\\n const [showModal, setShowModal] = useState(false);\\r\\n const [showImportModal, setShowImportModal] = useState(false); // 🛑 MODAL NUEVO\\r\\n \\r\\n // Estados de Edición\\r\\n const [isEditing, setIsEditing] = useState(false);\\r\\n const [isSubmitting, setIsSubmitting] = useState(false);\\r\\n const fileInputRef = useRef(null);\\r\\n\\r\\n // Estados del Reporte de Auditoría\\r\\n const [showWorkloadModal, setShowWorkloadModal] = useState(false);\\r\\n const [selectedEmployeeReport, setSelectedEmployeeReport] = useState(null);\\r\\n const [workloadReport, setWorkloadReport] = useState(null);\\r\\n const [reportLoading, setReportLoading] = useState(false);\\r\\n\\r\\n // Estado del Formulario\\r\\n const [formData, setFormData] = useState({\\r\\n uid: \'\',\\r\\n name: \'\',\\r\\n email: \'\',\\r\\n password: \'\',\\r\\n role: \'employee\',\\r\\n maxHoursPerMonth: 176,\\r\\n contractType: \'FullTime\',\\r\\n laborAgreement: \'SUVICO\' as LaborAgreement, // 🛑 NUEVO CAMPO\\r\\n isAvailable: true,\\r\\n clientId: \'\', \\r\\n dni: \'\',\\r\\n fileNumber: \'\',\\r\\n address: \'\',\\r\\n payrollCycleStartDay: 1,\\r\\n payrollCycleEndDay: 0,\\r\\n });\\r\\n\\r\\n // --- CARGA DE DATOS ---\\r\\n const fetchEmployees = async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const res = await callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: {} });\\r\\n const data = (res.data as any).data || [];\\r\\n setEmployees(data);\\r\\n } catch (error) {\\r\\n console.error(error);\\r\\n toast.error(\\"Error al cargar la nómina.\\");\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n useEffect(() => {\\r\\n fetchEmployees();\\r\\n }, []);\\r\\n\\r\\n const getClientName = (id?: string) => {\\r\\n if (!id) return Sin Asignación (Pool);\\r\\n const client = clients.find(c => c.id === id);\\r\\n return client ? (\\r\\n \\r\\n {client.businessName}\\r\\n \\r\\n ) : Cliente desconocido;\\r\\n };\\r\\n\\r\\n // --- LÓGICA DE IMPORTACIÓN MASIVA (NUEVA) ---\\r\\n const handleDownloadTemplate = () => {\\r\\n const headers = \\"nombre,email,dni,legajo,direccion,convenio,modalidad,horas_mensuales,inicio_ciclo\\\\n\\";\\r\\n const example = \\"Juan Perez,juan@mail.com,12345678,L-100,Av Colon 500,SUVICO,FullTime,176,1\\";\\r\\n const blob = new Blob([headers + example], { type: \'text/csv\' });\\r\\n const url = window.URL.createObjectURL(blob);\\r\\n const a = document.createElement(\'a\');\\r\\n a.href = url;\\r\\n a.download = \'plantilla_empleados.csv\';\\r\\n a.click();\\r\\n };\\r\\n\\r\\n const handleFileUpload = async (e: React.ChangeEvent) => {\\r\\n const file = e.target.files?.[0];\\r\\n if (!file) return;\\r\\n\\r\\n const reader = new FileReader();\\r\\n reader.onload = async (event) => {\\r\\n const text = event.target?.result as string;\\r\\n const rows = text.split(\'\\\\n\').slice(1); // Ignorar header\\r\\n \\r\\n const parsedData = rows.map(row => {\\r\\n const [name, email, dni, legajo, direccion, convenio, modalidad, horas, ciclo] = row.split(\',\');\\r\\n if (!email || !dni) return null; // Filtrar filas vacías\\r\\n return {\\r\\n name: name?.trim(),\\r\\n email: email?.trim(),\\r\\n dni: dni?.trim(),\\r\\n legajo: legajo?.trim(),\\r\\n direccion: direccion?.trim(),\\r\\n convenio: convenio?.trim(),\\r\\n modalidad: modalidad?.trim(),\\r\\n horas_mensuales: horas?.trim(),\\r\\n inicio_ciclo: ciclo?.trim()\\r\\n };\\r\\n }).filter(Boolean);\\r\\n\\r\\n if (parsedData.length === 0) {\\r\\n toast.error(\\"El archivo parece estar vacío o tiene formato incorrecto.\\");\\r\\n return;\\r\\n }\\r\\n\\r\\n if(!confirm(`Se encontraron ${parsedData.length} registros válidos.\\\\n¿Proceder con la importación?\\\\n\\\\nNota: La contraseña inicial será el DNI.`)) return;\\r\\n\\r\\n const toastId = toast.loading(`Importando ${parsedData.length} empleados...`);\\r\\n try {\\r\\n const res = await callManageEmployees({ \\r\\n action: \'IMPORT_EMPLOYEES\', \\r\\n payload: { rows: parsedData } \\r\\n });\\r\\n const result = (res.data as any).data;\\r\\n toast.success(`Importación finalizada.\\\\n✅ Éxitos: ${result.success}`, { id: toastId, duration: 5000 });\\r\\n \\r\\n if(result.errors.length > 0) {\\r\\n console.warn(\\"Errores de importación:\\", result.errors);\\r\\n toast(\\"Hubo algunos errores, revise la consola.\\", { icon: \'⚠️\' });\\r\\n }\\r\\n \\r\\n setShowImportModal(false);\\r\\n fetchEmployees();\\r\\n } catch (error: any) {\\r\\n toast.error(\\"Error crítico en importación: \\" + error.message, { id: toastId });\\r\\n }\\r\\n \\r\\n // Limpiar input\\r\\n if (fileInputRef.current) fileInputRef.current.value = \'\';\\r\\n };\\r\\n reader.readAsText(file);\\r\\n };\\r\\n\\r\\n // --- LÓGICA DE REPORTES ---\\r\\n const handleOpenWorkloadReport = async (emp: IEmployee) => {\\r\\n setSelectedEmployeeReport(emp);\\r\\n setShowWorkloadModal(true);\\r\\n setReportLoading(true);\\r\\n setWorkloadReport(null);\\r\\n\\r\\n try {\\r\\n const today = new Date();\\r\\n const res = await callManageEmployees({\\r\\n action: \'GET_WORKLOAD_REPORT\',\\r\\n payload: { \\r\\n uid: emp.uid, \\r\\n month: today.getMonth() + 1, \\r\\n year: today.getFullYear()\\r\\n }\\r\\n });\\r\\n setWorkloadReport((res.data as any).data as WorkloadReport);\\r\\n } catch (e: any) {\\r\\n toast.error(\\"Error al cargar reporte: \\" + e.message);\\r\\n } finally {\\r\\n setReportLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n // --- LÓGICA DE CRUD (FORMULARIO) ---\\r\\n const handleOpenCreate = () => {\\r\\n setFormData({ \\r\\n uid: \'\', name: \'\', email: \'\', password: \'\', role: \'employee\', \\r\\n maxHoursPerMonth: 176, contractType: \'FullTime\', laborAgreement: \'SUVICO\', isAvailable: true,\\r\\n clientId: selectedClientId || \'\', \\r\\n dni: \'\', fileNumber: \'\', address: \'\',\\r\\n payrollCycleStartDay: 1, \\r\\n payrollCycleEndDay: 0,\\r\\n });\\r\\n setIsEditing(false);\\r\\n setShowModal(true);\\r\\n };\\r\\n\\r\\n const handleOpenEdit = (emp: IEmployee) => {\\r\\n setFormData({\\r\\n uid: emp.uid,\\r\\n name: emp.name,\\r\\n email: emp.email,\\r\\n password: \'\', \\r\\n role: emp.role as string,\\r\\n maxHoursPerMonth: emp.maxHoursPerMonth || 176,\\r\\n contractType: emp.contractType || \'FullTime\',\\r\\n laborAgreement: emp.laborAgreement || \'SUVICO\',\\r\\n isAvailable: emp.isAvailable,\\r\\n clientId: emp.clientId || \'\',\\r\\n dni: emp.dni || \'\',\\r\\n fileNumber: emp.fileNumber || \'\',\\r\\n address: emp.address || \'\',\\r\\n payrollCycleStartDay: emp.payrollCycleStartDay || 1,\\r\\n payrollCycleEndDay: emp.payrollCycleEndDay || 0,\\r\\n });\\r\\n setIsEditing(true);\\r\\n setShowModal(true);\\r\\n };\\r\\n\\r\\n const handleSave = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setIsSubmitting(true);\\r\\n const toastId = toast.loading(isEditing ? \\"Actualizando...\\" : \\"Creando recurso...\\");\\r\\n\\r\\n try {\\r\\n if (isEditing) {\\r\\n const updatePayload = {\\r\\n name: formData.name,\\r\\n role: formData.role,\\r\\n maxHoursPerMonth: Number(formData.maxHoursPerMonth),\\r\\n contractType: formData.contractType,\\r\\n laborAgreement: formData.laborAgreement,\\r\\n isAvailable: formData.isAvailable,\\r\\n clientId: formData.clientId,\\r\\n dni: formData.dni,\\r\\n fileNumber: formData.fileNumber,\\r\\n address: formData.address,\\r\\n payrollCycleStartDay: Number(formData.payrollCycleStartDay),\\r\\n payrollCycleEndDay: Number(formData.payrollCycleEndDay),\\r\\n };\\r\\n await callManageEmployees({ action: \'UPDATE_EMPLOYEE\', payload: { uid: formData.uid, data: updatePayload } });\\r\\n toast.success(\\"Ficha actualizada correctamente\\", { id: toastId });\\r\\n } else {\\r\\n await callCreateUser({ \\r\\n email: formData.email, password: formData.password, name: formData.name, role: formData.role,\\r\\n clientId: formData.clientId, dni: formData.dni, fileNumber: formData.fileNumber, address: formData.address,\\r\\n });\\r\\n toast.success(\\"Empleado creado exitosamente\\", { id: toastId });\\r\\n }\\r\\n \\r\\n setShowModal(false);\\r\\n fetchEmployees();\\r\\n\\r\\n } catch (error: any) {\\r\\n console.error(error);\\r\\n toast.error(`Error: ${error.message}`, { id: toastId });\\r\\n } finally {\\r\\n setIsSubmitting(false);\\r\\n }\\r\\n };\\r\\n\\r\\n const handleDelete = async (uid: string) => {\\r\\n if (!confirm(\\"¿Eliminar este empleado? Esta acción borrará su acceso.\\")) return;\\r\\n try {\\r\\n await callManageEmployees({ action: \'DELETE_EMPLOYEE\', payload: { uid } });\\r\\n toast.success(\\"Empleado eliminado\\");\\r\\n fetchEmployees();\\r\\n } catch (error) {\\r\\n toast.error(\\"Error al eliminar\\");\\r\\n }\\r\\n };\\r\\n\\r\\n // 🛑 HELPER VISUAL: Agrupa horas por objetivo para el reporte\\r\\n const getHoursByObjective = (details: any[]) => {\\r\\n const summary: Record = {};\\r\\n details.forEach(d => {\\r\\n const name = d.objectiveName === \'Sede\' ? \'Sede (Genérico)\' : d.objectiveName;\\r\\n summary[name] = (summary[name] || 0) + d.duration;\\r\\n });\\r\\n return Object.entries(summary).map(([name, hours]) => ({ name, hours }));\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n {/* 1. HEADER CON BOTONES DE ACCIÓN */}\\r\\n
\\r\\n
\\r\\n

Nómina Global de Personal

\\r\\n

Gestión del pool de recursos de la agencia.

\\r\\n
\\r\\n
\\r\\n {/* 🛑 BOTÓN DE IMPORTACIÓN (NUEVO) */}\\r\\n \\r\\n \\r\\n {/* Botón Nuevo Recurso */}\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n {/* 2. TABLA DE EMPLEADOS */}\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {employees.map((emp) => (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n ))}\\r\\n \\r\\n
Legajo / NombreAsignaciónConvenioEstadoAcciones
handleOpenWorkloadReport(emp)}\\r\\n className=\\"px-6 py-4 whitespace-nowrap cursor-pointer hover:bg-indigo-50/50\\"\\r\\n title=\\"Ver auditoría de horas\\"\\r\\n >\\r\\n
#{emp.fileNumber || \'S/N\'}
\\r\\n
{emp.name}
\\r\\n
{emp.role}
\\r\\n
\\r\\n {getClientName(emp.clientId)}\\r\\n \\r\\n \\r\\n \\r\\n {emp.laborAgreement || \'SUVICO\'}\\r\\n \\r\\n \\r\\n {emp.isAvailable ? \\r\\n Activo : \\r\\n Inactivo\\r\\n }\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n {!loading && employees.length === 0 && (\\r\\n
\\r\\n \\r\\n

No hay empleados registrados en el sistema.

\\r\\n

Utilice el botón \\"Nuevo\\" o \\"Importar CSV\\".

\\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n\\r\\n {/* 3. MODAL DE IMPORTACIÓN (NUEVO) */}\\r\\n {showImportModal && (\\r\\n
\\r\\n
\\r\\n
\\r\\n

\\r\\n Importación Masiva\\r\\n

\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

Instrucciones:

\\r\\n
    \\r\\n
  • Descargue la plantilla CSV modelo.
  • \\r\\n
  • Complete los datos respetando las columnas.
  • \\r\\n
  • La contraseña inicial será el DNI del empleado.
  • \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* 4. MODAL DE FORMULARIO (CREAR/EDITAR) */}\\r\\n {showModal && (\\r\\n
\\r\\n
\\r\\n
\\r\\n

{isEditing ? \'Editar Ficha\' : \'Alta de Personal\'}

\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

Información Personal

\\r\\n
\\r\\n\\r\\n setFormData({...formData, name: e.target.value})} required />\\r\\n setFormData({...formData, dni: e.target.value})} required placeholder=\\"Sin puntos\\" />\\r\\n
\\r\\n setFormData({...formData, address: e.target.value})} required />\\r\\n
\\r\\n\\r\\n {!isEditing && (\\r\\n <>\\r\\n
\\r\\n

Acceso al Sistema

\\r\\n
\\r\\n setFormData({...formData, email: e.target.value})} required />\\r\\n setFormData({...formData, password: e.target.value})} required />\\r\\n \\r\\n )}\\r\\n\\r\\n
\\r\\n

Contratación y Asignación

\\r\\n
\\r\\n\\r\\n setFormData({...formData, fileNumber: e.target.value})} required />\\r\\n\\r\\n setFormData({...formData, clientId: e.target.value})}>\\r\\n \\r\\n {clients.map(c => )}\\r\\n \\r\\n\\r\\n setFormData({...formData, laborAgreement: e.target.value as any})}>\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n setFormData({...formData, contractType: e.target.value})}>\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n setFormData({...formData, maxHoursPerMonth: Number(e.target.value)})} required />\\r\\n\\r\\n
\\r\\n
Ciclo de Nómina
\\r\\n
\\r\\n setFormData({...formData, payrollCycleStartDay: Number(e.target.value)})}>\\r\\n \\r\\n {Array.from({ length: 31 }, (_, i) => i + 1).map(day => )}\\r\\n \\r\\n setFormData({...formData, payrollCycleEndDay: Number(e.target.value)})}>\\r\\n \\r\\n {Array.from({ length: 31 }, (_, i) => i + 1).map(day => )}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n {/* 5. MODAL DE REPORTE (AUDITORÍA DE HORAS) */}\\r\\n {showWorkloadModal && selectedEmployeeReport && (\\r\\n
\\r\\n
\\r\\n
\\r\\n

Ficha de Recurso y Auditoría de Horas

\\r\\n \\r\\n
\\r\\n \\r\\n

{selectedEmployeeReport.name} ({selectedEmployeeReport.dni})

\\r\\n\\r\\n {reportLoading ? (\\r\\n
Calculando reporte del mes...
\\r\\n ) : workloadReport ? (\\r\\n
\\r\\n \\r\\n {/* Info General */}\\r\\n
\\r\\n
\\r\\n

Legajo / Email

\\r\\n

{selectedEmployeeReport.fileNumber || \'S/N\'} / {selectedEmployeeReport.email}

\\r\\n
\\r\\n
\\r\\n

Dirección

\\r\\n

{selectedEmployeeReport.address || \'N/A\'}

\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Periodo y Ciclo */}\\r\\n
\\r\\n

Período de Cálculo

\\r\\n

\\r\\n {workloadReport.cycleStart} al {workloadReport.cycleEnd}\\r\\n (Definido por Ciclo de Nómina)\\r\\n

\\r\\n
\\r\\n \\r\\n {/* KPIs Principales */}\\r\\n
\\r\\n
\\r\\n

Límite Contratado

\\r\\n

{workloadReport.maxHours} hs

\\r\\n
\\r\\n
\\r\\n

Horas Asignadas

\\r\\n

{workloadReport.assignedHours} hs

\\r\\n {workloadReport.assignedHours > workloadReport.maxHours ? (\\r\\n

¡EXCESO DETECTADO!

\\r\\n ) : (\\r\\n

Dentro de límite

\\r\\n )}\\r\\n
\\r\\n
\\r\\n

Horas Trabajadas (Completed)

\\r\\n

{workloadReport.completedHours} hs

\\r\\n
\\r\\n
\\r\\n\\r\\n {/* 🛑 NUEVO GRÁFICO: RESUMEN POR OBJETIVO */}\\r\\n
\\r\\n
Distribución por Objetivo
\\r\\n
\\r\\n {getHoursByObjective(workloadReport.details).map((item, idx) => (\\r\\n
\\r\\n {item.name}\\r\\n {item.hours}h\\r\\n
\\r\\n ))}\\r\\n {workloadReport.details.length === 0 && Sin actividad registrada.}\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Detalle Diario */}\\r\\n
\\r\\n
Detalle Diario de Asignaciones
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {workloadReport.details.map((d, index) => (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n ))}\\r\\n \\r\\n
FechaDuraciónObjetivoEstado
{d.date} ({d.startTime}){d.duration} hs{d.objectiveName}\\r\\n \\r\\n {d.status}\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n ) : null}\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"GeocodingSelector.tsx","path":"apps/web/src/components/admin/GeocodingSelector.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState } from \'react\';\\r\\nimport toast from \'react-hot-toast\';\\r\\n\\r\\ninterface GeocodingSelectorProps {\\r\\n address: string;\\r\\n onCoordinatesSelected: (lat: string, lng: string) => void;\\r\\n onClose: () => void;\\r\\n isOpen: boolean;\\r\\n}\\r\\n\\r\\n/**\\r\\n * Componente Modal para buscar coordenadas geográficas a partir de una dirección.\\r\\n * Utiliza la API de Geocodificación de Google Maps.\\r\\n */\\r\\nexport const GeocodingSelector: React.FC = ({ address, onCoordinatesSelected, onClose, isOpen }) => {\\r\\n const [loading, setLoading] = useState(false);\\r\\n // Acceso seguro a la clave de API configurada en .env.local\\r\\n const apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY; \\r\\n\\r\\n if (!isOpen) return null;\\r\\n\\r\\n /**\\r\\n * Fetches coordinates for the given address using Google\'s Geocoding API.\\r\\n */\\r\\n const fetchCoordinates = async () => {\\r\\n if (!address.trim()) {\\r\\n toast.error(\\"Ingrese una dirección válida para buscar.\\");\\r\\n return;\\r\\n }\\r\\n // Verificación de seguridad\\r\\n if (!apiKey || apiKey.trim() === \'\') {\\r\\n toast.error(\\"Error: Falta la clave de Google Maps (NEXT_PUBLIC_GOOGLE_MAPS_API_KEY).\\");\\r\\n console.error(\\"GeocodingSelector: Missing Google Maps API Key.\\");\\r\\n return;\\r\\n }\\r\\n\\r\\n setLoading(true);\\r\\n const encodedAddress = encodeURIComponent(address);\\r\\n const url = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodedAddress}&key=${apiKey}`;\\r\\n\\r\\n try {\\r\\n const response = await fetch(url);\\r\\n const data = await response.json();\\r\\n\\r\\n if (data.status === \'OK\' && data.results.length > 0) {\\r\\n const { lat, lng } = data.results[0].geometry.location;\\r\\n \\r\\n // Mantenemos la alta precisión para el estado del formulario\\r\\n const latString = lat.toFixed(6); \\r\\n const lngString = lng.toFixed(6);\\r\\n\\r\\n onCoordinatesSelected(latString, lngString);\\r\\n toast.success(`Coordenadas asignadas a: ${address}`);\\r\\n onClose();\\r\\n } else {\\r\\n toast.error(\\"No se encontraron coordenadas para la dirección proporcionada.\\");\\r\\n }\\r\\n } catch (error) {\\r\\n console.error(\\"Error al consultar la API de Google:\\", error);\\r\\n toast.error(\\"Error de red al buscar coordenadas.\\");\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n \\r\\n // Estructura del Modal (usando Tailwind)\\r\\n return (\\r\\n
\\r\\n
\\r\\n

Buscar Coordenadas

\\r\\n

\\r\\n Dirección a buscar: {address}\\r\\n

\\r\\n \\r\\n \\r\\n {loading ? \'Buscando...\' : \'Confirmar Búsqueda en Mapa\'}\\r\\n \\r\\n \\r\\n \\r\\n Cancelar\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n};\\n\\n\\n\\n"},{"name":"labor-agreements-manager.tsx","path":"apps/web/src/components/admin/labor-agreements-manager.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport { httpsCallable } from \'firebase/functions\'; \\r\\nimport { functions } from \'@/services/firebase-client.service\';\\r\\nimport InputField from \'@/components/common/InputField\';\\r\\nimport Button from \'@/components/common/Button\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { Edit2, Trash2, Plus, Briefcase, Clock, Moon, DownloadCloud } from \'lucide-react\';\\r\\n\\r\\nconst callManageAgreements = httpsCallable(functions, \'manageAgreements\');\\r\\n\\r\\nexport function LaborAgreementsManager() {\\r\\n const [agreements, setAgreements] = useState([]);\\r\\n const [showModal, setShowModal] = useState(false);\\r\\n const [isEditing, setIsEditing] = useState(false);\\r\\n const [loading, setLoading] = useState(false);\\r\\n \\r\\n const [formData, setFormData] = useState({\\r\\n id: \'\',\\r\\n name: \'\', code: \'\', \\r\\n maxHoursWeekly: 48, maxHoursMonthly: 204, overtimeThresholdDaily: 12,\\r\\n saturdayCutoffHour: 13, nightShiftStart: 21, nightShiftEnd: 6\\r\\n });\\r\\n\\r\\n const loadData = async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const res = await callManageAgreements({ action: \'GET_ALL\', payload: {} });\\r\\n setAgreements((res.data as any).data || []);\\r\\n } catch (e) { console.error(e); toast.error(\\"Error cargando convenios\\"); }\\r\\n finally { setLoading(false); }\\r\\n };\\r\\n\\r\\n useEffect(() => { loadData(); }, []);\\r\\n\\r\\n // 🛑 FUNCIÓN DE IMPORTACIÓN\\r\\n const handleInitialize = async () => {\\r\\n const toastId = toast.loading(\\"Importando convenios estándar...\\");\\r\\n try {\\r\\n const res = await callManageAgreements({ action: \'INITIALIZE_DEFAULTS\', payload: {} });\\r\\n toast.success((res.data as any).message, { id: toastId });\\r\\n loadData();\\r\\n } catch (e: any) {\\r\\n toast.error(e.message, { id: toastId });\\r\\n }\\r\\n };\\r\\n\\r\\n const handleSubmit = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n const toastId = toast.loading(\\"Guardando...\\");\\r\\n try {\\r\\n if (isEditing) {\\r\\n await callManageAgreements({ action: \'UPDATE\', payload: { id: formData.id, data: formData } });\\r\\n } else {\\r\\n await callManageAgreements({ action: \'CREATE\', payload: formData });\\r\\n }\\r\\n toast.success(\\"Guardado correctamente\\", { id: toastId });\\r\\n setShowModal(false);\\r\\n loadData();\\r\\n } catch (e: any) { toast.error(e.message, { id: toastId }); }\\r\\n };\\r\\n\\r\\n const handleEdit = (item: any) => {\\r\\n setFormData(item);\\r\\n setIsEditing(true);\\r\\n setShowModal(true);\\r\\n };\\r\\n\\r\\n const handleDelete = async (id: string) => {\\r\\n if(!confirm(\\"¿Eliminar convenio?\\")) return;\\r\\n try {\\r\\n await callManageAgreements({ action: \'DELETE\', payload: { id } });\\r\\n toast.success(\\"Eliminado\\");\\r\\n loadData();\\r\\n } catch(e: any) { toast.error(e.message); }\\r\\n }\\r\\n\\r\\n const handleNew = () => {\\r\\n setFormData({ id: \'\', name: \'\', code: \'\', maxHoursWeekly: 48, maxHoursMonthly: 204, overtimeThresholdDaily: 12, saturdayCutoffHour: 13, nightShiftStart: 21, nightShiftEnd: 6 });\\r\\n setIsEditing(false);\\r\\n setShowModal(true);\\r\\n }\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n
\\r\\n

Reglas Laborales Activas

\\r\\n

Define los límites y parámetros de liquidación.

\\r\\n
\\r\\n
\\r\\n {/* Botón de Carga Inicial si está vacío */}\\r\\n {agreements.length === 0 && !loading && (\\r\\n \\r\\n )}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n {agreements.map(a => (\\r\\n
\\r\\n
\\r\\n
\\r\\n

{a.name}

\\r\\n {a.code}\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n Semanal\\r\\n {a.maxHoursWeekly} hs\\r\\n
\\r\\n
\\r\\n Mensual\\r\\n {a.maxHoursMonthly} hs\\r\\n
\\r\\n
\\r\\n Nocturnidad\\r\\n {a.nightShiftStart}:00 - {a.nightShiftEnd}:00\\r\\n
\\r\\n
\\r\\n
\\r\\n ))}\\r\\n \\r\\n {agreements.length === 0 && !loading && (\\r\\n
\\r\\n No hay convenios cargados. Usa el botón \\"Cargar Estándares\\" para iniciar.\\r\\n
\\r\\n )}\\r\\n
\\r\\n\\r\\n {/* Modal de Edición (Igual al anterior) */}\\r\\n {showModal && (\\r\\n
\\r\\n
\\r\\n

{isEditing ? \'Editar Regla\' : \'Nueva Regla Laboral\'}

\\r\\n
\\r\\n
\\r\\n
\\r\\n setFormData({...formData, name: e.target.value})} required />\\r\\n
\\r\\n setFormData({...formData, code: e.target.value})} required />\\r\\n setFormData({...formData, overtimeThresholdDaily: +e.target.value})} required />\\r\\n setFormData({...formData, maxHoursWeekly: +e.target.value})} required />\\r\\n setFormData({...formData, maxHoursMonthly: +e.target.value})} required />\\r\\n \\r\\n
\\r\\n

Extras y Nocturnidad

\\r\\n
\\r\\n setFormData({...formData, saturdayCutoffHour: +e.target.value})} required />\\r\\n setFormData({...formData, nightShiftStart: +e.target.value})} required />\\r\\n setFormData({...formData, nightShiftEnd: +e.target.value})} required />\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"login-form.tsx","path":"apps/web/src/components/admin/login-form.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState } from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { signInWithEmailAndPassword } from \'firebase/auth\';\\r\\nimport { auth } from \'@/services/firebase-client.service\';\\r\\n\\r\\nexport function LoginForm() {\\r\\n const [email, setEmail] = useState(\'\');\\r\\n const [password, setPassword] = useState(\'\');\\r\\n const [error, setError] = useState(\'\');\\r\\n const [loading, setLoading] = useState(false);\\r\\n const router = useRouter();\\r\\n\\r\\n // Colores personalizados basados en la imagen de referencia (Rojo ATM)\\r\\n const colors = {\\r\\n primary: \'#a81d1d\', // Rojo intenso\\r\\n primaryHover: \'#8c1818\',\\r\\n bgInput: \'#eff4fc\', // Fondo azul muy claro de los inputs\\r\\n textGray: \'#6b7280\',\\r\\n };\\r\\n\\r\\n const handleSubmit = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setError(\'\');\\r\\n setLoading(true);\\r\\n\\r\\n try {\\r\\n await signInWithEmailAndPassword(auth, email, password);\\r\\n router.push(\'/admin/dashboard\');\\r\\n } catch (err: any) {\\r\\n console.error(err);\\r\\n if (err.code === \'auth/invalid-credential\' || err.code === \'auth/user-not-found\' || err.code === \'auth/wrong-password\') {\\r\\n setError(\'Credenciales incorrectas. Verifique email y contraseña.\');\\r\\n } else if (err.code === \'auth/too-many-requests\') {\\r\\n setError(\'Demasiados intentos. Por favor espere unos minutos.\');\\r\\n } else {\\r\\n setError(\'Error al iniciar sesión. Intente nuevamente.\');\\r\\n }\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n {/* Tarjeta de Login con sombra suave y bordes redondeados */}\\r\\n
\\r\\n \\r\\n {/* Logo (Placeholder textual, puedes reemplazar por una etiqueta si tienes el logo en /public) */}\\r\\n
\\r\\n
\\r\\n {/* Icono/Logo Simulado en Rojo */}\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n

Sistema de Gestión

\\r\\n
\\r\\n

Inicia sesión para acceder al panel.

\\r\\n
\\r\\n \\r\\n
\\r\\n {/* Banner de Error Estilizado */}\\r\\n {error && (\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n

{error}

\\r\\n
\\r\\n
\\r\\n )}\\r\\n \\r\\n {/* Input Email con Icono */}\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n setEmail(e.target.value)}\\r\\n required\\r\\n />\\r\\n
\\r\\n\\r\\n {/* Input Password con Icono */}\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n setPassword(e.target.value)}\\r\\n required\\r\\n />\\r\\n
\\r\\n\\r\\n {/* Botón Submit */}\\r\\n \\r\\n {loading ? (\\r\\n <>\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Accediendo...\\r\\n \\r\\n ) : \'Acceder al Sistema\'}\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n

\\r\\n Ver 3.0 Beta\\r\\n

\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"new.tsx","path":"apps/web/src/components/admin/new.tsx","area":"FRONTEND","folder":"ADMIN","content":"// Archivo: ./src/components/admin/new.tsx (o la página asociada)\\r\\n\\r\\nimport React from \'react\';\\r\\nimport { withAuthGuard } from \'@/components/common/withAuthGuard\';\\r\\n// ✅ FIX CRÍTICO: Importamos DashboardLayout por defecto (SIN LLAVES)\\r\\nimport DashboardLayout from \'@/components/layout/DashboardLayout\'; \\r\\nimport { ClientSetupWizard } from \'@/components/admin/client-setup-wizard\';\\r\\n\\r\\nfunction NewClientPage() {\\r\\n return (\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\n// Exportación protegida (asumo roles de administración)\\r\\nexport default withAuthGuard(NewClientPage, [\'admin\']);\\n\\n\\n\\n"},{"name":"objective-management.tsx","path":"apps/web/src/components/admin/objective-management.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport { useRouter } from \'next/router\'; // 🛑 NECESARIO para la navegación de la tabla\\r\\nimport { callManageData } from \'@/services/firebase-client.service\';\\r\\nimport { IObjective } from \'@/common/interfaces/client.interface\';\\r\\nimport { useClient } from \'@/context/ClientContext\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { GeocodingSelector } from \'./GeocodingSelector\'; \\r\\nimport styles from \'./ObjectiveManagement.module.css\'; // Para cumplir con Next.js\\r\\n\\r\\n\\r\\n// -- 1. INTERFACES Y CONSTANTES (Sin cambios) --\\r\\ninterface ObjectiveFormState {\\r\\n name: string;\\r\\n address: string;\\r\\n latitude: string; \\r\\n longitude: string;\\r\\n}\\r\\n\\r\\nconst STYLES = {\\r\\n inputClass: \\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-200\\",\\r\\n readOnlyInputClass: \\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none bg-gray-50 text-gray-500 cursor-not-allowed sm:text-sm transition duration-200\\",\\r\\n labelClass: \\"block text-sm font-medium text-gray-700\\",\\r\\n buttonDisabled: \\"opacity-70 cursor-not-allowed\\",\\r\\n buttonActive: \\"hover:bg-indigo-700\\",\\r\\n};\\r\\n\\r\\nconst cleanAndParseCoordinate = (coordString: string): number => {\\r\\n const cleanedString = coordString.trim().replace(\',\', \'.\'); \\r\\n return parseFloat(cleanedString);\\r\\n};\\r\\n\\r\\n\\r\\nexport function ObjectiveManagement() {\\r\\n const router = useRouter(); // 🛑 Instancia del router\\r\\n const { selectedClientId, selectedClient } = useClient();\\r\\n\\r\\n const [objectives, setObjectives] = useState([]);\\r\\n const [isSelectorOpen, setIsSelectorOpen] = useState(false); \\r\\n \\r\\n const [formData, setFormData] = useState({\\r\\n name: \'\', address: \'\', latitude: \'\', longitude: \'\',\\r\\n });\\r\\n \\r\\n const [loading, setLoading] = useState(false);\\r\\n const [submitting, setSubmitting] = useState(false);\\r\\n\\r\\n /**\\r\\n * Carga de objetivos.\\r\\n */\\r\\n const fetchObjectives = async () => {\\r\\n if (!selectedClientId) {\\r\\n setObjectives([]);\\r\\n return;\\r\\n }\\r\\n setLoading(true);\\r\\n try {\\r\\n const result = await callManageData({ \\r\\n action: \'GET_ALL_OBJECTIVES\', \\r\\n payload: { clientId: selectedClientId } \\r\\n });\\r\\n const response = result.data as { success: boolean, data: IObjective[] };\\r\\n setObjectives(response.data || []);\\r\\n \\r\\n } catch (error) {\\r\\n console.error(\'[ObjectiveManagement] Fetch Error:\', error);\\r\\n toast.error(\\"Error al cargar objetivos\\");\\r\\n } finally { \\r\\n setLoading(false); \\r\\n }\\r\\n };\\r\\n\\r\\n useEffect(() => {\\r\\n fetchObjectives();\\r\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\r\\n }, [selectedClientId]);\\r\\n\\r\\n /**\\r\\n * Maneja el cambio en los inputs name y address.\\r\\n */\\r\\n const handleInputChange = (e: React.ChangeEvent) => {\\r\\n const { name, value } = e.target;\\r\\n if (name === \'name\' || name === \'address\') {\\r\\n setFormData(prev => ({ ...prev, [name]: value }));\\r\\n }\\r\\n };\\r\\n\\r\\n /**\\r\\n * Callback que recibe las coordenadas desde el GeocodingSelector y actualiza el estado.\\r\\n */\\r\\n const handleCoordinatesSelected = (lat: string, lng: string) => {\\r\\n setFormData(prev => ({\\r\\n ...prev,\\r\\n latitude: lat,\\r\\n longitude: lng,\\r\\n }));\\r\\n setIsSelectorOpen(false); // Cerramos el modal\\r\\n };\\r\\n\\r\\n /**\\r\\n * Valida y envía la creación del objetivo.\\r\\n */\\r\\n const handleCreateObjective = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n \\r\\n // 1. Pre-Submission Checks\\r\\n if (!selectedClientId) {\\r\\n toast.error(\\"⚠️ Debe seleccionar una empresa en el menú lateral.\\");\\r\\n return;\\r\\n }\\r\\n \\r\\n // Chequeo estricto de todos los campos obligatorios\\r\\n if (!formData.name.trim() || \\r\\n !formData.address.trim() ||\\r\\n !formData.latitude.trim() || \\r\\n !formData.longitude.trim() \\r\\n ) {\\r\\n toast.error(\\"Complete todos los campos obligatorios: Nombre, Dirección y Coordenadas.\\");\\r\\n return;\\r\\n }\\r\\n \\r\\n // 2. Parsing y Validación\\r\\n const lat = cleanAndParseCoordinate(formData.latitude);\\r\\n const lng = cleanAndParseCoordinate(formData.longitude);\\r\\n\\r\\n if (isNaN(lat) || isNaN(lng)) { \\r\\n toast.error(\\"Las coordenadas deben ser números válidos (ej: -34.60).\\"); \\r\\n return; \\r\\n }\\r\\n\\r\\n // 3. Submission Logic\\r\\n setSubmitting(true);\\r\\n try {\\r\\n const payload = { \\r\\n name: formData.name.trim(),\\r\\n address: formData.address.trim(),\\r\\n clientId: selectedClientId,\\r\\n location: { latitude: lat, longitude: lng } \\r\\n };\\r\\n \\r\\n await callManageData({ action: \'CREATE_OBJECTIVE\', payload });\\r\\n \\r\\n toast.success(`Objetivo \\"${formData.name}\\" creado para ${selectedClient?.businessName}`);\\r\\n setFormData({ name: \'\', address: \'\', latitude: \'\', longitude: \'\' });\\r\\n fetchObjectives();\\r\\n\\r\\n } catch (error) { \\r\\n console.error(\'[ObjectiveManagement] Create Error:\', error);\\r\\n toast.error(\\"Error al crear el objetivo.\\"); \\r\\n } finally { \\r\\n setSubmitting(false); \\r\\n }\\r\\n };\\r\\n\\r\\n\\r\\n return (\\r\\n
\\r\\n {/* --- FORMULARIO (Sección 1) --- */}\\r\\n
\\r\\n {/* ... Header del formulario ... */}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n {/* Botón para Activar la Búsqueda de Coordenadas */}\\r\\n \\r\\n\\r\\n {/* Botón Final de Creación */}\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n {/* INTEGRACIÓN DEL MODAL DE GEOCODIFICACIÓN */}\\r\\n setIsSelectorOpen(false)}\\r\\n onCoordinatesSelected={handleCoordinatesSelected}\\r\\n />\\r\\n \\r\\n {/* --- LISTADO DE OBJETIVOS (Sección 2) --- */}\\r\\n
\\r\\n
\\r\\n

\\r\\n Objetivos de {selectedClient?.businessName || \'...\'}\\r\\n

\\r\\n {objectives.length}\\r\\n
\\r\\n {loading ?
Cargando datos...
: (\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {objectives.length === 0 ? (\\r\\n \\r\\n ) : (\\r\\n objectives.map((obj) => (\\r\\n router.push(`/admin/objective-detail/${obj.id}`)} \\r\\n >\\r\\n \\r\\n \\r\\n ))\\r\\n )}\\r\\n \\r\\n
Nombre y Ubicación
No hay objetivos registrados para esta empresa.
\\r\\n
\\r\\n
\\r\\n {obj.name.charAt(0).toUpperCase()}\\r\\n
\\r\\n
\\r\\n
{obj.name}
\\r\\n
{obj.address}
\\r\\n
\\r\\n ({obj.location?.latitude?.toFixed(4) || \'N/A\'}, {obj.location?.longitude?.toFixed(4) || \'N/A\'})\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n );\\r\\n}\\r\\n\\r\\nexport default ObjectiveManagement;\\n\\n\\n\\n"},{"name":"ObjectiveManagement.module.css","path":"apps/web/src/components/admin/ObjectiveManagement.module.css","area":"FRONTEND","folder":"ADMIN","content":"/* Archivo: ObjectiveManagement.module.css\\r\\n\\r\\nESTE ARCHIVO DEBE CONTENER EXCLUSIVAMENTE CLASES LOCALES (INICIADAS CON \'.\')\\r\\nPARA CUMPLIR CON LAS REGLAS DE CSS MODULES DE NEXT.JS. \\r\\nNO INCLUYE SELECTORES DE ELEMENTOS (h1, p, div) NI SELECTORES GLOBALES (:global()).\\r\\n*/\\r\\n\\r\\n/* EJEMPLO DE CLASE ÚNICA:\\r\\nSolo usamos esta clase para que la compilación de Next.js/Turbopack\\r\\nconfirme que el archivo module.css es válido y no global.\\r\\n*/\\r\\n.objectiveListCard {\\r\\n /* Aquí podrías añadir estilos locales que no puedes lograr con Tailwind, \\r\\n como animaciones complejas o variables CSS */\\r\\n padding: 1px; /* Espaciado mínimo o ajuste local */\\r\\n transition: box-shadow 0.3s ease-in-out;\\r\\n}\\r\\n\\r\\n/* SI NECESITAS ESTILOS ESPECÍFICOS DE LA LISTA:\\r\\n.listItem {\\r\\n border-left: 5px solid #4f46e5;\\r\\n}\\r\\n*/"},{"name":"GanttPlanningView.tsx","path":"apps/web/src/components/admin/planning/GanttPlanningView.tsx","area":"FRONTEND","folder":"PLANNING","content":"import React, { useState, useEffect, useCallback } from \'react\';\\r\\nimport { \\r\\n format, addDays, \\r\\n eachDayOfInterval, isSameDay, differenceInMinutes, \\r\\n startOfDay \\r\\n} from \'date-fns\';\\r\\nimport { es } from \'date-fns/locale\';\\r\\nimport { \\r\\n ChevronLeft, ChevronRight, Search, Zap, Loader2, \\r\\n ZoomIn, ZoomOut, X, Clock, User, MapPin, CheckCircle2 \\r\\n} from \'lucide-react\';\\r\\nimport { collection, query, where, getDocs, Timestamp } from \'firebase/firestore\';\\r\\nimport { db, callManageData } from \'@/services/firebase-client.service\';\\r\\nimport { useClient } from \'@/context/ClientContext\';\\r\\nimport { IObjective } from \'@/common/interfaces/client.interface\';\\r\\nimport { IShift } from \'@/common/interfaces/shift.interface\';\\r\\n\\r\\nexport function GanttPlanningView() {\\r\\n const { selectedClientId } = useClient();\\r\\n \\r\\n // Estado de Datos\\r\\n const [currentDate, setCurrentDate] = useState(new Date());\\r\\n const [objectives, setObjectives] = useState([]);\\r\\n const [shifts, setShifts] = useState([]);\\r\\n const [loading, setLoading] = useState(false);\\r\\n const [searchTerm, setSearchTerm] = useState(\'\');\\r\\n\\r\\n // Estado de UI (Zoom y Modal)\\r\\n const [cellWidth, setCellWidth] = useState(180); // Ancho base más grande por día\\r\\n const [selectedShift, setSelectedShift] = useState(null);\\r\\n\\r\\n // Constantes\\r\\n const DAYS_TO_SHOW = 14; \\r\\n\\r\\n // Helper de fechas\\r\\n const safeDate = (val: any): Date => {\\r\\n if (!val) return new Date();\\r\\n if (val.toDate && typeof val.toDate === \'function\') return val.toDate();\\r\\n if (val.seconds) return new Date(val.seconds * 1000);\\r\\n if (typeof val === \'string\') return new Date(val);\\r\\n return new Date(val);\\r\\n };\\r\\n\\r\\n // 1. Cargar Datos\\r\\n const fetchData = useCallback(async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const payload = selectedClientId ? { clientId: selectedClientId } : {};\\r\\n const objRes = await callManageData({ action: \'GET_ALL_OBJECTIVES\', payload });\\r\\n const loadedObjs = (objRes.data as any).data as IObjective[];\\r\\n setObjectives(loadedObjs || []);\\r\\n\\r\\n if (loadedObjs && loadedObjs.length > 0) {\\r\\n const startDate = startOfDay(currentDate);\\r\\n const endDate = addDays(startDate, DAYS_TO_SHOW);\\r\\n \\r\\n // Limitamos query para evitar errores, idealmente paginar o filtrar por zona\\r\\n const targetIds = loadedObjs.slice(0, 15).map(o => o.id);\\r\\n \\r\\n if (targetIds.length > 0) {\\r\\n const shiftsRef = collection(db, \'turnos\');\\r\\n const q = query(\\r\\n shiftsRef,\\r\\n where(\'objectiveId\', \'in\', targetIds),\\r\\n where(\'startTime\', \'>=\', Timestamp.fromDate(startDate)),\\r\\n where(\'startTime\', \'<=\', Timestamp.fromDate(endDate))\\r\\n );\\r\\n\\r\\n const snapshot = await getDocs(q);\\r\\n const loadedShifts = snapshot.docs.map(doc => ({ id: doc.id, ...doc.data() })) as IShift[];\\r\\n setShifts(loadedShifts);\\r\\n }\\r\\n } else {\\r\\n setShifts([]);\\r\\n }\\r\\n } catch (error) {\\r\\n console.error(\\"Error cargando Gantt:\\", error);\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n }, [selectedClientId, currentDate]);\\r\\n\\r\\n useEffect(() => { fetchData(); }, [fetchData]);\\r\\n\\r\\n // 2. Generar Días\\r\\n const days = eachDayOfInterval({\\r\\n start: startOfDay(currentDate),\\r\\n end: addDays(startOfDay(currentDate), DAYS_TO_SHOW - 1)\\r\\n });\\r\\n\\r\\n const filteredObjectives = objectives.filter(o => \\r\\n o.name.toLowerCase().includes(searchTerm.toLowerCase())\\r\\n );\\r\\n\\r\\n // 3. Estilos Dinámicos (Zoom)\\r\\n const getShiftStyle = (shift: IShift) => {\\r\\n const start = safeDate(shift.startTime);\\r\\n const end = safeDate(shift.endTime);\\r\\n const viewStart = startOfDay(currentDate);\\r\\n\\r\\n if (isNaN(start.getTime()) || isNaN(end.getTime())) return null;\\r\\n\\r\\n const startDiffMins = differenceInMinutes(start, viewStart);\\r\\n const durationMins = differenceInMinutes(end, start);\\r\\n \\r\\n // Factor de Zoom: cellWidth px por 1440 minutos (1 día)\\r\\n const pixelsPerMinute = cellWidth / 1440;\\r\\n \\r\\n const left = startDiffMins * pixelsPerMinute;\\r\\n const width = durationMins * pixelsPerMinute;\\r\\n\\r\\n if (left + width < 0) return null;\\r\\n\\r\\n return {\\r\\n left: `${left}px`,\\r\\n width: `${Math.max(width, 4)}px`\\r\\n };\\r\\n };\\r\\n\\r\\n // Controladores de Zoom\\r\\n const handleZoomIn = () => setCellWidth(prev => Math.min(prev + 50, 600)); // Máx 600px por día\\r\\n const handleZoomOut = () => setCellWidth(prev => Math.max(prev - 50, 60)); // Mín 60px por día\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n {/* Header Herramientas */}\\r\\n
\\r\\n
\\r\\n

\\r\\n \\r\\n Cronograma Lineal\\r\\n

\\r\\n \\r\\n {/* Navegación Fechas */}\\r\\n
\\r\\n \\r\\n \\r\\n {format(currentDate, \'d MMM\', { locale: es })} - {format(addDays(currentDate, DAYS_TO_SHOW - 1), \'d MMM\', { locale: es })}\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n {/* Controles de Zoom */}\\r\\n
\\r\\n \\r\\n Zoom\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n {loading && Cargando...}\\r\\n
\\r\\n \\r\\n setSearchTerm(e.target.value)}\\r\\n />\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n {/* Columna Izquierda: Objetivos */}\\r\\n
\\r\\n
\\r\\n Sede / Objetivo\\r\\n
\\r\\n
\\r\\n {filteredObjectives.map((obj) => (\\r\\n
\\r\\n
\\r\\n
\\r\\n {obj.name.charAt(0)}\\r\\n
\\r\\n
\\r\\n

{obj.name}

\\r\\n

{obj.address}

\\r\\n
\\r\\n
\\r\\n
\\r\\n ))}\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Área del Gráfico */}\\r\\n
\\r\\n
\\r\\n {/* Cabecera de Días */}\\r\\n
\\r\\n {days.map(d => {\\r\\n const isToday = isSameDay(d, new Date());\\r\\n return (\\r\\n
\\r\\n
\\r\\n \\r\\n {format(d, \'EEE\', { locale: es })}\\r\\n \\r\\n \\r\\n {format(d, \'d\')}\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n\\r\\n {/* Cuerpo del Gráfico */}\\r\\n
\\r\\n {/* Líneas de guía verticales (Días y Sub-divisiones horarias) */}\\r\\n
\\r\\n {days.map(d => (\\r\\n
\\r\\n {/* Líneas tenues cada 6 horas (00, 06, 12, 18) si hay suficiente zoom */}\\r\\n {cellWidth > 150 && (\\r\\n <>\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n )}\\r\\n
\\r\\n ))}\\r\\n
\\r\\n\\r\\n {/* Filas de Datos */}\\r\\n {filteredObjectives.map((obj) => {\\r\\n const objShifts = shifts.filter(s => s.objectiveId === obj.id);\\r\\n\\r\\n return (\\r\\n
\\r\\n {objShifts.map(shift => {\\r\\n const style = getShiftStyle(shift);\\r\\n if (!style) return null;\\r\\n \\r\\n const isVacant = shift.employeeId === \'VACANTE\';\\r\\n const start = safeDate(shift.startTime);\\r\\n const end = safeDate(shift.endTime);\\r\\n\\r\\n return (\\r\\n
setSelectedShift(shift)} // 🛑 ABRIR MODAL\\r\\n className={`absolute top-3 h-10 rounded-md shadow-sm border text-[10px] flex flex-col justify-center px-2 cursor-pointer transition-all hover:brightness-110 hover:shadow-md hover:scale-[1.01] hover:z-30 overflow-hidden whitespace-nowrap\\r\\n ${isVacant \\r\\n ? \'bg-gray-100 border-gray-300 text-gray-400 border-dashed\' \\r\\n : shift.isOvertime \\r\\n ? \'bg-amber-500 border-amber-600 text-white\'\\r\\n : \'bg-indigo-600 border-indigo-700 text-white\'\\r\\n }\\r\\n `}\\r\\n style={style}\\r\\n title={`${shift.employeeName} (${format(start, \'HH:mm\')} - ${format(end, \'HH:mm\')})`}\\r\\n >\\r\\n {isVacant ? \'VACANTE\' : shift.employeeName}\\r\\n {cellWidth > 80 && (\\r\\n {format(start, \'HH:mm\')} - {format(end, \'HH:mm\')}\\r\\n )}\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {/* 🛑 MODAL DE DETALLE DEL TURNO */}\\r\\n {selectedShift && (\\r\\n
\\r\\n
\\r\\n
\\r\\n

\\r\\n Detalle de Turno\\r\\n

\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n {/* Empleado */}\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n {selectedShift.employeeName === \'VACANTE\' ? \'V\' : selectedShift.employeeName.charAt(0)}\\r\\n
\\r\\n
\\r\\n

{selectedShift.employeeName}

\\r\\n

{selectedShift.employeeId === \'VACANTE\' ? \'Posición vacante\' : \'Asignado\'}

\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Horario y Lugar */}\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n {format(safeDate(selectedShift.startTime), \'HH:mm\')} - {format(safeDate(selectedShift.endTime), \'HH:mm\')}\\r\\n

\\r\\n

{differenceInMinutes(safeDate(selectedShift.endTime), safeDate(selectedShift.startTime)) / 60} horas

\\r\\n
\\r\\n
\\r\\n \\r\\n

{selectedShift.objectiveName}

\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Estado */}\\r\\n
\\r\\n
\\r\\n \\r\\n Estado: {selectedShift.status === \'Assigned\' ? \'Programado\' : selectedShift.status}\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"ObjectiveMatrixView.tsx","path":"apps/web/src/components/admin/planning/ObjectiveMatrixView.tsx","area":"FRONTEND","folder":"PLANNING","content":"import React, { useState, useEffect, useMemo } from \'react\';\\r\\nimport { startOfMonth, endOfMonth, eachDayOfInterval, format, getDay } from \'date-fns\';\\r\\nimport { es } from \'date-fns/locale\';\\r\\nimport { IShift } from \'@/common/interfaces/shift.interface\';\\r\\nimport { IEmployee } from \'@/common/interfaces/employee.interface\';\\r\\nimport { IObjective } from \'@/common/interfaces/client.interface\';\\r\\nimport { callManageData, callManageEmployees, db } from \'@/services/firebase-client.service\';\\r\\nimport { collection, query, where, getDocs, Timestamp } from \'firebase/firestore\';\\r\\nimport { RefreshCw, FileSpreadsheet, MapPin, FileDown, Printer } from \'lucide-react\'; // Iconos nuevos\\r\\nimport Button from \'@/components/common/Button\';\\r\\nimport toast from \'react-hot-toast\';\\r\\n\\r\\n// Librerías de Exportación\\r\\nimport * as XLSX from \'xlsx\';\\r\\nimport { saveAs } from \'file-saver\';\\r\\nimport jsPDF from \'jspdf\';\\r\\nimport autoTable from \'jspdf-autotable\';\\r\\n\\r\\nexport function ObjectiveMatrixView() {\\r\\n const [loading, setLoading] = useState(false);\\r\\n const [objectives, setObjectives] = useState([]);\\r\\n const [selectedObjectiveId, setSelectedObjectiveId] = useState(\'\');\\r\\n \\r\\n const [currentDate, setCurrentDate] = useState(new Date());\\r\\n const [shifts, setShifts] = useState([]);\\r\\n const [employees, setEmployees] = useState([]);\\r\\n\\r\\n // 1. Cargar Objetivos\\r\\n useEffect(() => {\\r\\n const loadObj = async () => {\\r\\n try {\\r\\n const res = await callManageData({ action: \'GET_ALL_OBJECTIVES\', payload: {} });\\r\\n const data = (res.data as any).data || [];\\r\\n setObjectives(data);\\r\\n if (data.length > 0) setSelectedObjectiveId(data[0].id);\\r\\n } catch (e) { console.error(e); }\\r\\n };\\r\\n loadObj();\\r\\n }, []);\\r\\n\\r\\n // 2. Cargar Datos\\r\\n const loadMatrixData = async () => {\\r\\n if (!selectedObjectiveId) return;\\r\\n setLoading(true);\\r\\n try {\\r\\n const start = startOfMonth(currentDate);\\r\\n const end = endOfMonth(currentDate);\\r\\n\\r\\n // A. Turnos\\r\\n const shiftsRef = collection(db, \'turnos\');\\r\\n const q = query(\\r\\n shiftsRef,\\r\\n where(\'objectiveId\', \'==\', selectedObjectiveId),\\r\\n where(\'startTime\', \'>=\', Timestamp.fromDate(start)),\\r\\n where(\'startTime\', \'<=\', Timestamp.fromDate(end))\\r\\n );\\r\\n const snap = await getDocs(q);\\r\\n const loadedShifts = snap.docs.map(d => ({ id: d.id, ...d.data() } as IShift));\\r\\n setShifts(loadedShifts);\\r\\n\\r\\n // B. Empleados\\r\\n const uniqueEmpIds = Array.from(new Set(loadedShifts.map(s => s.employeeId).filter(id => id !== \'VACANTE\')));\\r\\n \\r\\n if (uniqueEmpIds.length > 0) {\\r\\n const obj = objectives.find(o => o.id === selectedObjectiveId);\\r\\n const empRes = await callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: { clientId: obj?.clientId } });\\r\\n const allEmps = (empRes.data as any).data as IEmployee[];\\r\\n setEmployees(allEmps.filter(e => uniqueEmpIds.includes(e.uid)));\\r\\n } else {\\r\\n setEmployees([]);\\r\\n }\\r\\n\\r\\n } catch (e: any) {\\r\\n toast.error(\\"Error cargando matriz: \\" + e.message);\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n useEffect(() => {\\r\\n loadMatrixData();\\r\\n }, [selectedObjectiveId, currentDate]);\\r\\n\\r\\n const daysInMonth = useMemo(() => {\\r\\n return eachDayOfInterval({\\r\\n start: startOfMonth(currentDate),\\r\\n end: endOfMonth(currentDate)\\r\\n });\\r\\n }, [currentDate]);\\r\\n\\r\\n // 3. Helper Visual (M, T, N, F)\\r\\n const getShiftVisual = (shift?: IShift) => {\\r\\n if (!shift) return { code: \'\', color: \'bg-white\' };\\r\\n\\r\\n // Detección de Franco\\r\\n if ((shift.role && shift.role.toLowerCase().includes(\'franco\')) || \\r\\n (shift.employeeName && shift.employeeName.toLowerCase().includes(\'franco\'))) {\\r\\n return { code: \'F\', color: \'bg-slate-800 text-white font-bold\' }; \\r\\n }\\r\\n\\r\\n const startHour = shift.startTime instanceof Timestamp ? shift.startTime.toDate().getHours() : new Date(shift.startTime).getHours();\\r\\n\\r\\n if (startHour >= 6 && startHour < 14) return { code: \'M\', color: \'bg-sky-200 text-sky-800 font-bold\' };\\r\\n if (startHour >= 14 && startHour < 22) return { code: \'T\', color: \'bg-amber-100 text-amber-800 font-bold\' };\\r\\n if (startHour >= 22 || startHour < 6) return { code: \'N\', color: \'bg-slate-700 text-white font-bold\' };\\r\\n\\r\\n return { code: \'X\', color: \'bg-gray-100\' };\\r\\n };\\r\\n\\r\\n // --- 4. EXPORTAR EXCEL ---\\r\\n const handleExportExcel = () => {\\r\\n const objName = objectives.find(o => o.id === selectedObjectiveId)?.name || \'Cronograma\';\\r\\n const monthStr = format(currentDate, \'MMMM_yyyy\', { locale: es });\\r\\n \\r\\n // Encabezados\\r\\n const headers = [\'Legajo\', \'Apellido y Nombre\', ...daysInMonth.map(d => format(d, \'dd\')), \'Total Hs\'];\\r\\n \\r\\n // Filas\\r\\n const dataRows = employees.map(emp => {\\r\\n let totalHours = 0;\\r\\n const daysData = daysInMonth.map(day => {\\r\\n const dayKey = format(day, \'yyyy-MM-dd\'); // 🛑 FIX ZONA HORARIA LOCAL\\r\\n const shift = shifts.find(s => {\\r\\n const sDate = s.startTime instanceof Timestamp ? s.startTime.toDate() : new Date(s.startTime);\\r\\n return format(sDate, \'yyyy-MM-dd\') === dayKey && s.employeeId === emp.uid && s.status !== \'Canceled\';\\r\\n });\\r\\n\\r\\n if (!shift) return \'\';\\r\\n const visual = getShiftVisual(shift);\\r\\n \\r\\n // Sumar horas si no es franco\\r\\n if (visual.code !== \'F\') {\\r\\n const start = shift.startTime instanceof Timestamp ? shift.startTime.toDate() : new Date(shift.startTime);\\r\\n const end = shift.endTime instanceof Timestamp ? shift.endTime.toDate() : new Date(shift.endTime);\\r\\n totalHours += (end.getTime() - start.getTime()) / 3600000;\\r\\n }\\r\\n return visual.code;\\r\\n });\\r\\n\\r\\n return [emp.fileNumber || \'\', emp.name, ...daysData, Math.round(totalHours)];\\r\\n });\\r\\n\\r\\n // Crear Libro\\r\\n const wb = XLSX.utils.book_new();\\r\\n const ws = XLSX.utils.aoa_to_sheet([\\r\\n [`CRONOGRAMA: ${objName.toUpperCase()} - ${monthStr.toUpperCase()}`], // Título\\r\\n [], \\r\\n headers, \\r\\n ...dataRows\\r\\n ]);\\r\\n\\r\\n XLSX.utils.book_append_sheet(wb, ws, \\"Cronograma\\");\\r\\n const excelBuffer = XLSX.write(wb, { bookType: \'xlsx\', type: \'array\' });\\r\\n const data = new Blob([excelBuffer], { type: \'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8\' });\\r\\n saveAs(data, `Cronograma_${objName}_${monthStr}.xlsx`);\\r\\n };\\r\\n\\r\\n // --- 5. EXPORTAR PDF ---\\r\\n const handleExportPDF = () => {\\r\\n const doc = new jsPDF({ orientation: \'landscape\' });\\r\\n const objName = objectives.find(o => o.id === selectedObjectiveId)?.name || \'Cronograma\';\\r\\n const monthStr = format(currentDate, \'MMMM yyyy\', { locale: es }).toUpperCase();\\r\\n\\r\\n doc.setFontSize(14);\\r\\n doc.text(`CRONOGRAMA: ${objName} - ${monthStr}`, 14, 15);\\r\\n\\r\\n const head = [[\'Legajo\', \'Nombre\', ...daysInMonth.map(d => format(d, \'dd\')), \'Hs\']];\\r\\n \\r\\n const body = employees.map(emp => {\\r\\n let totalHours = 0;\\r\\n const row = [\\r\\n emp.fileNumber || \'\',\\r\\n emp.name,\\r\\n ...daysInMonth.map(day => {\\r\\n const dayKey = format(day, \'yyyy-MM-dd\'); // 🛑 FIX ZONA HORARIA LOCAL\\r\\n const shift = shifts.find(s => {\\r\\n const sDate = s.startTime instanceof Timestamp ? s.startTime.toDate() : new Date(s.startTime);\\r\\n return format(sDate, \'yyyy-MM-dd\') === dayKey && s.employeeId === emp.uid && s.status !== \'Canceled\';\\r\\n });\\r\\n \\r\\n if (!shift) return \'\';\\r\\n const visual = getShiftVisual(shift);\\r\\n if (visual.code !== \'F\') {\\r\\n const start = shift.startTime instanceof Timestamp ? shift.startTime.toDate() : new Date(shift.startTime);\\r\\n const end = shift.endTime instanceof Timestamp ? shift.endTime.toDate() : new Date(shift.endTime);\\r\\n totalHours += (end.getTime() - start.getTime()) / 3600000;\\r\\n }\\r\\n return visual.code;\\r\\n }),\\r\\n String(Math.round(totalHours)) // Convertir a string para autoTable\\r\\n ];\\r\\n // Push the totalHours as the last element of the row, correctly typed.\\r\\n row[row.length - 1] = String(Math.round(totalHours));\\r\\n return row;\\r\\n });\\r\\n\\r\\n autoTable(doc, {\\r\\n head: head,\\r\\n body: body,\\r\\n startY: 20,\\r\\n styles: { fontSize: 6, cellPadding: 1, halign: \'center\', valign: \'middle\' }, // Letra chica para que entre\\r\\n headStyles: { fillColor: [30, 41, 59] }, // Slate-800\\r\\n columnStyles: {\\r\\n 0: { cellWidth: 15 }, // Legajo\\r\\n 1: { cellWidth: 40, halign: \'left\' }, // Nombre\\r\\n // El resto automático\\r\\n },\\r\\n theme: \'grid\'\\r\\n });\\r\\n\\r\\n doc.save(`Cronograma_${objName}_${monthStr}.pdf`);\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n {/* Header */}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Matriz de Turnos

\\r\\n

Vista compacta mensual por objetivo.

\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n setCurrentDate(new Date(e.target.value + \'-01\'))}\\r\\n />\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n {/* BOTONES DE EXPORTACIÓN */}\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n {/* TABLA MATRIZ */}\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {daysInMonth.map(d => (\\r\\n \\r\\n ))}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {daysInMonth.map(d => (\\r\\n \\r\\n ))}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {employees.length === 0 && (\\r\\n \\r\\n )}\\r\\n \\r\\n {/* Filas de Empleados */}\\r\\n {employees.map(emp => {\\r\\n let totalHours = 0;\\r\\n return (\\r\\n \\r\\n \\r\\n {daysInMonth.map(day => {\\r\\n // 🛑 FIX: Usar format para evitar cambio de día por UTC\\r\\n const dayKey = format(day, \'yyyy-MM-dd\');\\r\\n \\r\\n const shift = shifts.find(s => {\\r\\n const sDate = s.startTime instanceof Timestamp ? s.startTime.toDate() : new Date(s.startTime);\\r\\n // Comparamos strings locales\\r\\n return format(sDate, \'yyyy-MM-dd\') === dayKey && s.employeeId === emp.uid && s.status !== \'Canceled\';\\r\\n });\\r\\n\\r\\n const visual = getShiftVisual(shift);\\r\\n \\r\\n if (shift && visual.code !== \'F\') {\\r\\n const start = shift.startTime instanceof Timestamp ? shift.startTime.toDate() : new Date(shift.startTime);\\r\\n const end = shift.endTime instanceof Timestamp ? shift.endTime.toDate() : new Date(shift.endTime);\\r\\n totalHours += (end.getTime() - start.getTime()) / 3600000;\\r\\n }\\r\\n\\r\\n return (\\r\\n \\r\\n );\\r\\n })}\\r\\n \\r\\n \\r\\n );\\r\\n })}\\r\\n \\r\\n
\\r\\n {format(currentDate, \'MMMM yyyy\', { locale: es }).toUpperCase()}\\r\\n \\r\\n {format(d, \'EEEEE\', { locale: es })}\\r\\n TOT
\\r\\n Legajo / Guardia\\r\\n \\r\\n {format(d, \'d\')}\\r\\n Hs
No hay personal asignado en este período.
\\r\\n
{emp.name}
\\r\\n
{emp.fileNumber || \'S/L\'}
\\r\\n
\\r\\n {shift ? (\\r\\n
\\r\\n {visual.code}\\r\\n
\\r\\n ) : null}\\r\\n
\\r\\n {Math.round(totalHours)}\\r\\n
\\r\\n
\\r\\n\\r\\n {/* Referencias */}\\r\\n
\\r\\n Referencias:\\r\\n
Mañana (06-14)
\\r\\n
Tarde (14-22)
\\r\\n
Noche (22-06)
\\r\\n
Franco
\\r\\n
\\r\\n
\\r\\n );\\r\\n}\\n\\n"},{"name":"scheduler.tsx","path":"apps/web/src/components/admin/scheduler.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useReducer, useMemo, useEffect, useState } from \'react\';\\r\\nimport { \\r\\n format, \\r\\n addMonths, \\r\\n subMonths, \\r\\n startOfMonth, \\r\\n endOfMonth, \\r\\n startOfWeek, \\r\\n endOfWeek, \\r\\n isSameDay, \\r\\n addDays, \\r\\n parseISO, \\r\\n setHours, \\r\\n setMinutes,\\r\\n differenceInMinutes,\\r\\n addMinutes,\\r\\n startOfDay,\\r\\n endOfDay,\\r\\n isBefore,\\r\\n isAfter,\\r\\n max,\\r\\n min\\r\\n} from \'date-fns\';\\r\\nimport { es } from \'date-fns/locale\';\\r\\nimport { \\r\\n ChevronLeft, \\r\\n ChevronRight, \\r\\n Clock,\\r\\n Lock,\\r\\n ZoomIn,\\r\\n ZoomOut\\r\\n} from \'lucide-react\';\\r\\nimport { clsx, type ClassValue } from \'clsx\';\\r\\nimport { twMerge } from \'tailwind-merge\';\\r\\n\\r\\nfunction cn(...inputs: ClassValue[]) {\\r\\n return twMerge(clsx(inputs));\\r\\n}\\r\\n\\r\\nexport type ViewType = \'month\' | \'week\' | \'day\';\\r\\n\\r\\nexport interface SchedulerEvent {\\r\\n id: string;\\r\\n title: string;\\r\\n description?: string;\\r\\n start: Date | string;\\r\\n end: Date | string;\\r\\n color?: string;\\r\\n originalData?: any;\\r\\n}\\r\\n\\r\\ninterface SchedulerState {\\r\\n currentDate: Date;\\r\\n view: ViewType;\\r\\n}\\r\\n\\r\\ntype SchedulerAction = \\r\\n | { type: \'SET_VIEW\'; payload: ViewType }\\r\\n | { type: \'NAVIGATE_NEXT\' }\\r\\n | { type: \'NAVIGATE_PREV\' }\\r\\n | { type: \'NAVIGATE_TODAY\' }\\r\\n | { type: \'SET_DATE\'; payload: Date };\\r\\n\\r\\ninterface SchedulerProps {\\r\\n events: SchedulerEvent[];\\r\\n isLoading?: boolean;\\r\\n onEventClick?: (event: SchedulerEvent) => void;\\r\\n onDropInfo?: (data: { employeeId: string, employeeName: string, start?: Date, end?: Date, targetShiftId?: string }) => void;\\r\\n onEventMove?: (event: SchedulerEvent, newStart: Date, newEnd: Date) => void;\\r\\n onDateChange?: (date: Date) => void;\\r\\n onViewChange?: (view: ViewType) => void;\\r\\n startHour?: number;\\r\\n endHour?: number;\\r\\n readOnly?: boolean;\\r\\n}\\r\\n\\r\\nconst schedulerReducer = (state: SchedulerState, action: SchedulerAction): SchedulerState => {\\r\\n switch (action.type) {\\r\\n case \'SET_VIEW\': return { ...state, view: action.payload };\\r\\n case \'NAVIGATE_NEXT\': {\\r\\n const { view, currentDate } = state;\\r\\n let nextDate = view === \'month\' ? addMonths(currentDate, 1) : addDays(currentDate, view === \'week\' ? 7 : 1);\\r\\n return { ...state, currentDate: nextDate };\\r\\n }\\r\\n case \'NAVIGATE_PREV\': {\\r\\n const { view, currentDate } = state;\\r\\n let prevDate = view === \'month\' ? subMonths(currentDate, 1) : addDays(currentDate, view === \'week\' ? -7 : -1);\\r\\n return { ...state, currentDate: prevDate };\\r\\n }\\r\\n case \'NAVIGATE_TODAY\': return { ...state, currentDate: new Date() };\\r\\n case \'SET_DATE\': return { ...state, currentDate: action.payload };\\r\\n default: return state;\\r\\n }\\r\\n};\\r\\n\\r\\nconst Scheduler: React.FC = ({ \\r\\n events = [], \\r\\n isLoading = false, \\r\\n onEventClick, \\r\\n onDropInfo, \\r\\n onEventMove,\\r\\n onDateChange,\\r\\n onViewChange,\\r\\n startHour = 0, \\r\\n endHour = 24,\\r\\n readOnly = false\\r\\n}) => {\\r\\n \\r\\n const [state, dispatch] = useReducer(schedulerReducer, { currentDate: new Date(), view: \'week\' });\\r\\n \\r\\n // 🛑 NUEVO: Estado para el Zoom (Altura de celda dinámica)\\r\\n const [cellHeight, setCellHeight] = useState(60); \\r\\n\\r\\n useEffect(() => { if (onDateChange) onDateChange(state.currentDate); }, [state.currentDate, onDateChange]);\\r\\n useEffect(() => { if (onViewChange) onViewChange(state.view); }, [state.view, onViewChange]);\\r\\n\\r\\n const normalizedEvents = useMemo(() => {\\r\\n return events.map(evt => ({\\r\\n ...evt,\\r\\n start: typeof evt.start === \'string\' ? parseISO(evt.start) : evt.start,\\r\\n end: typeof evt.end === \'string\' ? parseISO(evt.end) : evt.end,\\r\\n }));\\r\\n }, [events]);\\r\\n\\r\\n // --- HANDLERS ---\\r\\n\\r\\n const handleSlotDrop = (e: React.DragEvent, day: Date, hour: number) => {\\r\\n e.preventDefault();\\r\\n if (readOnly) return;\\r\\n\\r\\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\\r\\n const offsetY = e.clientY - rect.top;\\r\\n const minutesAdded = Math.floor((offsetY / cellHeight) * 60);\\r\\n const roundedMinutes = Math.round(minutesAdded / 15) * 15; \\r\\n\\r\\n const newStart = new Date(day);\\r\\n newStart.setHours(hour, roundedMinutes, 0, 0);\\r\\n\\r\\n const movedShiftId = e.dataTransfer.getData(\\"shiftId\\");\\r\\n if (movedShiftId && onEventMove) {\\r\\n const shift = normalizedEvents.find(s => s.id === movedShiftId);\\r\\n if (shift) {\\r\\n const durationMs = (shift.end as Date).getTime() - (shift.start as Date).getTime();\\r\\n const newEnd = new Date(newStart.getTime() + durationMs);\\r\\n onEventMove(shift, newStart, newEnd);\\r\\n }\\r\\n return;\\r\\n }\\r\\n\\r\\n const employeeId = e.dataTransfer.getData(\\"employeeId\\");\\r\\n const employeeName = e.dataTransfer.getData(\\"employeeName\\");\\r\\n if (employeeId && onDropInfo) {\\r\\n const end = addMinutes(newStart, 480); \\r\\n onDropInfo({ employeeId, employeeName, start: newStart, end });\\r\\n }\\r\\n };\\r\\n\\r\\n const handleEventDrop = (e: React.DragEvent, targetEvent: SchedulerEvent) => {\\r\\n e.preventDefault();\\r\\n e.stopPropagation(); \\r\\n if (readOnly) return;\\r\\n\\r\\n const employeeId = e.dataTransfer.getData(\\"employeeId\\");\\r\\n const employeeName = e.dataTransfer.getData(\\"employeeName\\");\\r\\n\\r\\n if (employeeId && onDropInfo) {\\r\\n onDropInfo({ \\r\\n employeeId, \\r\\n employeeName, \\r\\n targetShiftId: targetEvent.id \\r\\n });\\r\\n }\\r\\n };\\r\\n\\r\\n const renderMonthView = () => {\\r\\n const monthStart = startOfMonth(state.currentDate);\\r\\n const monthEnd = endOfMonth(monthStart);\\r\\n const startDate = startOfWeek(monthStart, { weekStartsOn: 1 });\\r\\n const endDate = endOfWeek(monthEnd, { weekStartsOn: 1 });\\r\\n \\r\\n let days: React.ReactNode[] = []; \\r\\n let day = startDate;\\r\\n const rows = [];\\r\\n\\r\\n while (day <= endDate) {\\r\\n for (let i = 0; i < 7; i++) {\\r\\n const cloneDay = day;\\r\\n const isToday = isSameDay(day, new Date());\\r\\n const dayEvents = normalizedEvents\\r\\n .filter(e => isSameDay(e.start as Date, cloneDay))\\r\\n .sort((a, b) => (a.start as Date).getTime() - (b.start as Date).getTime());\\r\\n \\r\\n days.push(\\r\\n
dispatch({ type: \'SET_DATE\', payload: cloneDay })}\\r\\n onDragOver={!readOnly ? (e) => e.preventDefault() : undefined}\\r\\n onDrop={!readOnly ? (e) => {\\r\\n const employeeId = e.dataTransfer.getData(\\"employeeId\\");\\r\\n const employeeName = e.dataTransfer.getData(\\"employeeName\\");\\r\\n if (employeeId && onDropInfo) {\\r\\n const start = setHours(cloneDay, 9);\\r\\n const end = setHours(cloneDay, 17);\\r\\n onDropInfo({ employeeId, employeeName, start, end });\\r\\n }\\r\\n } : undefined}\\r\\n >\\r\\n
\\r\\n \\r\\n {format(day, \'d\')}\\r\\n \\r\\n
\\r\\n
{/* 🛑 Scroll si hay muchos */}\\r\\n {dayEvents.map(evt => (\\r\\n
{ e.stopPropagation(); onEventClick?.(evt); }} \\r\\n className={cn(\\"text-[10px] px-1 rounded truncate cursor-pointer flex items-center gap-1 shadow-sm\\", evt.color || \\"bg-blue-100 text-blue-800\\")}\\r\\n title={evt.title}\\r\\n draggable={!readOnly}\\r\\n onDragStart={!readOnly ? (e) => {\\r\\n e.dataTransfer.setData(\\"shiftId\\", evt.id);\\r\\n e.dataTransfer.effectAllowed = \\"move\\";\\r\\n } : undefined}\\r\\n onDragOver={!readOnly ? (e) => e.preventDefault() : undefined}\\r\\n onDrop={!readOnly ? (e) => handleEventDrop(e, evt) : undefined}\\r\\n >\\r\\n {readOnly && }\\r\\n {format(evt.start as Date, \'HH:mm\')} {evt.title}\\r\\n
\\r\\n ))}\\r\\n
\\r\\n
\\r\\n );\\r\\n day = addDays(day, 1);\\r\\n }\\r\\n rows.push(
{days}
);\\r\\n days = []; \\r\\n }\\r\\n return
{rows}
;\\r\\n };\\r\\n\\r\\n const renderTimeGrid = () => {\\r\\n let daysToShow = state.view === \'week\' \\r\\n ? Array.from({ length: 7 }).map((_, i) => addDays(startOfWeek(state.currentDate, { weekStartsOn: 1 }), i))\\r\\n : [state.currentDate];\\r\\n\\r\\n const hours = Array.from({ length: endHour - startHour }).map((_, i) => startHour + i);\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n {daysToShow.map(day => {\\r\\n const isToday = isSameDay(day, new Date());\\r\\n return (\\r\\n
\\r\\n
{format(day, \'EEE\', { locale: es })}
\\r\\n
{format(day, \'d\')}
\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n {hours.map(h => {\\r\\n const timeLabel = setMinutes(setHours(new Date(), h), 0);\\r\\n return (\\r\\n
\\r\\n {format(timeLabel, \'HH:mm\')}\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n {hours.map(h =>
)}\\r\\n
\\r\\n\\r\\n {daysToShow.map(day => {\\r\\n // 🛑 FIX NOCTURNIDAD: Definimos el rango del día actual (00:00 a 23:59)\\r\\n const columnStart = startOfDay(day);\\r\\n const columnEnd = endOfDay(day);\\r\\n\\r\\n // Filtramos eventos que se superponen con este día (aunque hayan empezado ayer)\\r\\n const dayEvents = normalizedEvents.filter(evt => {\\r\\n const s = evt.start as Date;\\r\\n const e = evt.end as Date;\\r\\n return isBefore(s, columnEnd) && isAfter(e, columnStart);\\r\\n });\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n {!readOnly && (\\r\\n
\\r\\n {hours.map(h => (\\r\\n
{ e.preventDefault(); e.dataTransfer.dropEffect = \\"move\\"; }}\\r\\n onDrop={(e) => handleSlotDrop(e, day, h)}\\r\\n />\\r\\n ))}\\r\\n
\\r\\n )}\\r\\n\\r\\n {dayEvents.map(evt => {\\r\\n const originalStart = evt.start as Date;\\r\\n const originalEnd = evt.end as Date;\\r\\n\\r\\n // 🛑 FIX: Recortamos visualmente el evento para que quepa en este día\\r\\n // Si empieza ayer, visualmente empieza a las 00:00 de hoy\\r\\n const visualStart = isBefore(originalStart, columnStart) ? columnStart : originalStart;\\r\\n // Si termina mañana, visualmente termina a las 23:59 de hoy\\r\\n const visualEnd = isAfter(originalEnd, columnEnd) ? columnEnd : originalEnd;\\r\\n \\r\\n const startH = visualStart.getHours();\\r\\n const startM = visualStart.getMinutes();\\r\\n \\r\\n // Si el fragmento termina antes de la hora de inicio de la vista, ignorar\\r\\n if (visualEnd.getHours() < startHour) return null; \\r\\n \\r\\n const minsFromTop = (Math.max(startH, startHour) - startHour) * 60 + startM;\\r\\n const top = Math.max(0, (minsFromTop / 60) * cellHeight);\\r\\n \\r\\n const durationMins = differenceInMinutes(visualEnd, visualStart);\\r\\n const height = (durationMins / 60) * cellHeight;\\r\\n\\r\\n // Ajuste mínimo para que se vea\\r\\n const displayHeight = Math.max(height, 20);\\r\\n\\r\\n return (\\r\\n { e.stopPropagation(); onEventClick?.(evt); }}\\r\\n draggable={!readOnly}\\r\\n onDragStart={!readOnly ? (e) => {\\r\\n e.dataTransfer.setData(\\"shiftId\\", evt.id);\\r\\n e.dataTransfer.effectAllowed = \\"move\\";\\r\\n } : undefined}\\r\\n onDragOver={!readOnly ? (e) => { \\r\\n e.preventDefault(); \\r\\n e.stopPropagation(); \\r\\n e.dataTransfer.dropEffect = \\"copy\\"; \\r\\n } : undefined} \\r\\n onDrop={!readOnly ? (e) => handleEventDrop(e, evt) : undefined} \\r\\n \\r\\n className={cn(\\r\\n \\"absolute left-1 right-1 rounded border-l-4 p-1 shadow-sm cursor-pointer transition-all text-xs overflow-hidden group z-10\\", \\r\\n !readOnly && \\"hover:z-50 hover:brightness-95 hover:shadow-md\\", \\r\\n readOnly && \\"opacity-90\\", \\r\\n evt.color || \\"bg-indigo-50 border-indigo-500\\"\\r\\n )}\\r\\n style={{ top: `${top}px`, height: `${displayHeight}px` }}\\r\\n title={`${evt.title}\\\\n${format(originalStart, \'HH:mm\')} - ${format(originalEnd, \'HH:mm\')}`}\\r\\n >\\r\\n {readOnly && }\\r\\n
{evt.title}
\\r\\n
\\r\\n \\r\\n {/* Mostramos horario real, aunque visualmente esté cortado */}\\r\\n {format(originalStart, \'HH:mm\')} - {format(originalEnd, \'HH:mm\')}\\r\\n
\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n );\\r\\n })}\\r\\n
\\r\\n
\\r\\n
\\r\\n );\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n

{format(state.currentDate, \'MMMM yyyy\', { locale: es })}

\\r\\n
\\r\\n \\r\\n
\\r\\n {/* 🛑 CONTROLES DE ZOOM */}\\r\\n {(state.view === \'week\' || state.view === \'day\') && (\\r\\n
\\r\\n \\r\\n {Math.round((cellHeight/60)*100)}%\\r\\n \\r\\n
\\r\\n )}\\r\\n\\r\\n {readOnly && Lectura}\\r\\n {isLoading && Cargando...}\\r\\n
\\r\\n {([\'month\', \'week\', \'day\'] as ViewType[]).map(v => (\\r\\n \\r\\n ))}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n {state.view === \'month\' ? renderMonthView() : renderTimeGrid()}\\r\\n
\\r\\n
\\r\\n );\\r\\n};\\r\\n\\r\\nexport const DragAndDropScheduler = React.memo(Scheduler);\\r\\nexport default DragAndDropScheduler;\\n\\n\\n\\n"},{"name":"shift-assignment-form.tsx","path":"apps/web/src/components/admin/shift-assignment-form.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState } from \'react\';\\r\\nimport { callScheduleShift } from \'@/services/firebase-client.service\';\\r\\nimport { Timestamp } from \'firebase/firestore\'; \\r\\n\\r\\nexport function ShiftAssignmentForm() {\\r\\n const [employeeId, setEmployeeId] = useState(\'user_id_cajero_001\'); // Placeholder\\r\\n const [objectiveId, setObjectiveId] = useState(\'obj_id_sucursal_centro\'); // Placeholder\\r\\n const [startTime, setStartTime] = useState(\'\'); \\r\\n const [endTime, setEndTime] = useState(\'\');\\r\\n const [message, setMessage] = useState<{ text: string, type: \'success\' | \'error\' } | null>(null);\\r\\n const [loading, setLoading] = useState(false);\\r\\n\\r\\n const handleSubmit = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n setMessage(null);\\r\\n setLoading(true);\\r\\n\\r\\n try {\\r\\n const shiftData = {\\r\\n employeeId,\\r\\n objectiveId,\\r\\n startTime: Timestamp.fromDate(new Date(startTime)), \\r\\n endTime: Timestamp.fromDate(new Date(endTime)),\\r\\n };\\r\\n\\r\\n const result = await callScheduleShift(shiftData);\\r\\n const data = result.data as { success: boolean, shiftId: string, message: string };\\r\\n setMessage({ text: data.message || \\"Turno asignado correctamente\\", type: \'success\' });\\r\\n \\r\\n } catch (err: any) {\\r\\n const errorMessage = err.details || err.message;\\r\\n setMessage({ text: `Error: ${errorMessage}`, type: \'error\' });\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n const inputClass = \\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\\";\\r\\n const labelClass = \\"block text-sm font-medium text-gray-700\\";\\r\\n\\r\\n return (\\r\\n
\\r\\n {message && (\\r\\n
\\r\\n {message.text}\\r\\n
\\r\\n )}\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n setStartTime(e.target.value)} required className={inputClass} />\\r\\n
\\r\\n
\\r\\n \\r\\n setEndTime(e.target.value)} required className={inputClass} />\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"system-user-management.tsx","path":"apps/web/src/components/admin/system-user-management.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport { callManageSystemUsers } from \'@/services/firebase-client.service\';\\r\\nimport { ISystemUser } from \'@/common/interfaces/system-user.interface\';\\r\\nimport toast from \'react-hot-toast\';\\r\\n\\r\\nexport function SystemUserManagement() {\\r\\n const [users, setUsers] = useState([]);\\r\\n const [loading, setLoading] = useState(true);\\r\\n const [showModal, setShowModal] = useState(false);\\r\\n const [isEditing, setIsEditing] = useState(false);\\r\\n\\r\\n // Formulario\\r\\n const [formData, setFormData] = useState({\\r\\n uid: \'\',\\r\\n displayName: \'\',\\r\\n email: \'\',\\r\\n password: \'\',\\r\\n role: \'Scheduler\',\\r\\n status: \'Active\'\\r\\n });\\r\\n\\r\\n const fetchUsers = async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const res = await callManageSystemUsers({ action: \'GET_ALL_USERS\', payload: {} });\\r\\n const data = (res.data as any).data || [];\\r\\n setUsers(data);\\r\\n } catch (error) {\\r\\n console.error(error);\\r\\n toast.error(\\"Error al cargar usuarios.\\");\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n useEffect(() => {\\r\\n fetchUsers();\\r\\n }, []);\\r\\n\\r\\n const handleOpenCreate = () => {\\r\\n setFormData({ uid: \'\', displayName: \'\', email: \'\', password: \'\', role: \'Scheduler\', status: \'Active\' });\\r\\n setIsEditing(false);\\r\\n setShowModal(true);\\r\\n };\\r\\n\\r\\n const handleSave = async (e: React.FormEvent) => {\\r\\n e.preventDefault();\\r\\n const toastId = toast.loading(\\"Procesando...\\");\\r\\n\\r\\n try {\\r\\n if (isEditing) {\\r\\n // Solo enviamos lo que cambia\\r\\n const payload = {\\r\\n uid: formData.uid,\\r\\n data: {\\r\\n role: formData.role,\\r\\n status: formData.status,\\r\\n displayName: formData.displayName\\r\\n }\\r\\n };\\r\\n await callManageSystemUsers({ action: \'UPDATE_USER\', payload });\\r\\n toast.success(\\"Usuario actualizado\\", { id: toastId });\\r\\n } else {\\r\\n await callManageSystemUsers({ \\r\\n action: \'CREATE_USER\', \\r\\n payload: {\\r\\n email: formData.email,\\r\\n password: formData.password,\\r\\n displayName: formData.displayName,\\r\\n role: formData.role\\r\\n }\\r\\n });\\r\\n toast.success(\\"Administrador creado\\", { id: toastId });\\r\\n }\\r\\n setShowModal(false);\\r\\n fetchUsers();\\r\\n } catch (error: any) {\\r\\n toast.error(`Error: ${error.message}`, { id: toastId });\\r\\n }\\r\\n };\\r\\n\\r\\n const handleDelete = async (uid: string) => {\\r\\n if (!confirm(\\"¿Eliminar este administrador? Perderá el acceso inmediatamente.\\")) return;\\r\\n try {\\r\\n await callManageSystemUsers({ action: \'DELETE_USER\', payload: { uid } });\\r\\n toast.success(\\"Usuario eliminado\\");\\r\\n fetchUsers();\\r\\n } catch (error) {\\r\\n toast.error(\\"Error al eliminar\\");\\r\\n }\\r\\n };\\r\\n\\r\\n // Estilos\\r\\n const inputClass = \\"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\\";\\r\\n const labelClass = \\"block text-sm font-medium text-gray-700\\";\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n
\\r\\n

Usuarios del Sistema

\\r\\n

Gestione el acceso al panel administrativo.

\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n {/* Tabla */}\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {users.map((user) => (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n ))}\\r\\n \\r\\n
UsuarioRolEstadoAcciones
\\r\\n
\\r\\n
\\r\\n {user.displayName.charAt(0)}\\r\\n
\\r\\n
\\r\\n
{user.displayName}
\\r\\n
{user.email}
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n {user.role}\\r\\n \\r\\n \\r\\n \\r\\n {user.status}\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n {/* Modal */}\\r\\n {showModal && (\\r\\n
\\r\\n
\\r\\n

{isEditing ? \'Editar Usuario\' : \'Nuevo Administrador\'}

\\r\\n
\\r\\n
setFormData({...formData, displayName: e.target.value})} required />
\\r\\n {!isEditing && (\\r\\n <>\\r\\n
setFormData({...formData, email: e.target.value})} required />
\\r\\n
setFormData({...formData, password: e.target.value})} required />
\\r\\n \\r\\n )}\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n )}\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"SystemStatus.tsx","path":"apps/web/src/components/admin/SystemStatus.tsx","area":"FRONTEND","folder":"ADMIN","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport { callManageHierarchy, callManageEmployees, callCheckSystemHealth, auth } from \'@/services/firebase-client.service\';\\r\\n\\r\\ninterface HealthMetric {\\r\\n name: string;\\r\\n status: \'pending\' | \'ok\' | \'warning\' | \'error\';\\r\\n value?: string;\\r\\n details?: string;\\r\\n}\\r\\n\\r\\nexport function SystemStatus() {\\r\\n const [metrics, setMetrics] = useState([\\r\\n { name: \'Conectividad Internet\', status: \'pending\' },\\r\\n { name: \'Sesión de Usuario (Auth)\', status: \'pending\' },\\r\\n { name: \'Servidor (Cloud Functions)\', status: \'pending\' },\\r\\n { name: \'Base de Datos (Firestore)\', status: \'pending\' },\\r\\n { name: \'Módulo Jerarquía\', status: \'pending\' },\\r\\n { name: \'Módulo RRHH\', status: \'pending\' },\\r\\n ]);\\r\\n const [isRunning, setIsRunning] = useState(false);\\r\\n\\r\\n useEffect(() => { runDiagnostics(); }, []);\\r\\n\\r\\n const updateMetric = (index: number, status: HealthMetric[\'status\'], value: string, details: string = \'\') => {\\r\\n setMetrics(prev => {\\r\\n const newM = [...prev];\\r\\n newM[index] = { ...newM[index], status, value, details };\\r\\n return newM;\\r\\n });\\r\\n };\\r\\n\\r\\n const runDiagnostics = async () => {\\r\\n setIsRunning(true);\\r\\n \\r\\n // 1. Local Checks\\r\\n const isOnline = navigator.onLine;\\r\\n updateMetric(0, isOnline ? \'ok\' : \'error\', isOnline ? \'Online\' : \'Offline\');\\r\\n if (!isOnline) { setIsRunning(false); return; }\\r\\n\\r\\n const user = auth.currentUser;\\r\\n updateMetric(1, user ? \'ok\' : \'error\', user ? \'Autenticado\' : \'Sin Sesión\', user?.uid);\\r\\n\\r\\n // 2. Health Check Real (Ping al servidor)\\r\\n const startServer = Date.now();\\r\\n try {\\r\\n const healthRes = await callCheckSystemHealth({});\\r\\n const endServer = Date.now();\\r\\n const data = healthRes.data as any;\\r\\n\\r\\n updateMetric(2, \'ok\', `${endServer - startServer}ms`, `Node ${data.nodeVersion}`);\\r\\n \\r\\n const dbLat = data.database.latencyMs;\\r\\n updateMetric(3, data.database.status === \'connected\' ? \'ok\' : \'error\', `${dbLat}ms`);\\r\\n\\r\\n } catch (error: any) {\\r\\n updateMetric(2, \'error\', \'Fallo Crítico\', error.message);\\r\\n updateMetric(3, \'error\', \'Inaccesible\', \'Timeout o Error 500\');\\r\\n }\\r\\n\\r\\n // 3. Smoke Test de Módulos\\r\\n await testModule(4, async () => callManageHierarchy({ action: \'GET_ALL_CLIENTS\', payload: {} }));\\r\\n await testModule(5, async () => callManageEmployees({ action: \'GET_ALL_EMPLOYEES\', payload: {} }));\\r\\n\\r\\n setIsRunning(false);\\r\\n };\\r\\n\\r\\n const testModule = async (index: number, call: () => Promise) => {\\r\\n const start = Date.now();\\r\\n try {\\r\\n await call();\\r\\n updateMetric(index, \'ok\', `${Date.now() - start}ms`, \'Operativo\');\\r\\n } catch (error: any) {\\r\\n updateMetric(index, \'error\', \'Fallo\', error.message);\\r\\n }\\r\\n };\\r\\n\\r\\n return (\\r\\n
\\r\\n
\\r\\n

Monitor de Salud

\\r\\n \\r\\n
\\r\\n
\\r\\n {metrics.map((m, idx) => (\\r\\n
\\r\\n
\\r\\n

{m.name}

\\r\\n
\\r\\n
\\r\\n {m.status === \'pending\' ? \'...\' : m.value}\\r\\n
\\r\\n
\\r\\n {m.details &&
{m.details}
}\\r\\n
\\r\\n ))}\\r\\n
\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"Button.tsx","path":"apps/web/src/components/common/Button.tsx","area":"FRONTEND","folder":"COMMON","content":"import React from \'react\';\\r\\n\\r\\ninterface ButtonProps extends React.ButtonHTMLAttributes {\\r\\n primary?: boolean;\\r\\n children: React.ReactNode;\\r\\n}\\r\\n\\r\\n/**\\r\\n * @description Reusable button component with basic Tailwind styles.\\r\\n */\\r\\nexport default function Button({ primary = true, children, className, disabled, ...props }: ButtonProps) {\\r\\n const baseStyle = \\"px-4 py-2 rounded-lg font-semibold transition-colors duration-150\\";\\r\\n const primaryStyle = \\"bg-indigo-600 text-white hover:bg-indigo-700 disabled:bg-indigo-300\\";\\r\\n const secondaryStyle = \\"bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:bg-gray-100\\";\\r\\n\\r\\n return (\\r\\n \\r\\n {children}\\r\\n \\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"InputField.tsx","path":"apps/web/src/components/common/InputField.tsx","area":"FRONTEND","folder":"COMMON","content":"import React from \'react\';\\r\\n\\r\\ninterface InputFieldProps extends React.InputHTMLAttributes {\\r\\n label: string;\\r\\n id: string;\\r\\n type?: \'text\' | \'email\' | \'password\' | \'number\' | \'date\' | \'textarea\';\\r\\n rows?: number;\\r\\n}\\r\\n\\r\\n/**\\r\\n * @description Reusable input/textarea component.\\r\\n */\\r\\nexport default function InputField({ label, id, type = \'text\', rows = 1, className, ...props }: InputFieldProps) {\\r\\n const inputStyle = \\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 p-2 text-sm\\";\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n {type === \'textarea\' ? (\\r\\n }\\r\\n />\\r\\n ) : (\\r\\n }\\r\\n />\\r\\n )}\\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"SelectField.tsx","path":"apps/web/src/components/common/SelectField.tsx","area":"FRONTEND","folder":"COMMON","content":"import React from \'react\';\\r\\n\\r\\ninterface SelectFieldProps extends React.SelectHTMLAttributes {\\r\\n label: string;\\r\\n id: string;\\r\\n children: React.ReactNode;\\r\\n}\\r\\n\\r\\n/**\\r\\n * @description Reusable select (dropdown) component.\\r\\n */\\r\\nexport default function SelectField({ label, id, children, className, ...props }: SelectFieldProps) {\\r\\n const selectStyle = \\"w-full border-gray-300 rounded-lg shadow-sm focus:ring-indigo-500 focus:border-indigo-500 py-2 text-sm\\";\\r\\n \\r\\n return (\\r\\n
\\r\\n \\r\\n \\r\\n {children}\\r\\n \\r\\n
\\r\\n );\\r\\n}\\n\\n\\n\\n"},{"name":"shift.interface.ts","path":"apps/web/src/components/common/shift.interface.ts","area":"FRONTEND","folder":"COMMON","content":"/**\\r\\n * @file shift.interface.ts\\r\\n * @description Definición de la estructura de un Turno (Shift) compartido entre Frontend y Backend.\\r\\n */\\r\\n\\r\\n// Definimos un tipo flexible para las fechas para soportar:\\r\\n// 1. admin.firestore.Timestamp (Backend)\\r\\n// 2. firebase.firestore.Timestamp (Frontend SDK)\\r\\n// 3. Date (Objetos JS nativos tras conversión)\\r\\n// 4. { seconds: number, nanoseconds: number } (JSON serializado)\\r\\nexport type FirestoreDate = any; \\r\\n\\r\\nexport type ShiftStatus = \'Scheduled\' | \'In Progress\' | \'Completed\' | \'Absent\';\\r\\n\\r\\nexport interface IShift {\\r\\n id: string; // ID del documento en Firestore\\r\\n \\r\\n // Relación con Empleado\\r\\n employeeId: string;\\r\\n employeeName: string;\\r\\n \\r\\n // Relación con Objetivo (Cliente/Sede)\\r\\n objectiveId: string;\\r\\n objectiveName: string; // 🛑 Requerido para mostrar en el Dashboard\\r\\n \\r\\n // Tiempos\\r\\n startTime: FirestoreDate;\\r\\n endTime: FirestoreDate;\\r\\n \\r\\n // Estado del ciclo de vida\\r\\n status: ShiftStatus;\\r\\n \\r\\n // Datos opcionales de auditoría en el mismo documento (si aplica)\\r\\n checkInTime?: FirestoreDate;\\r\\n checkOutTime?: FirestoreDate;\\r\\n \\r\\n // Metadatos\\r\\n role?: string; // Rol del empleado durante ese turno (ej: \'Vigilador\', \'Supervisor\')\\r\\n}\\n\\n\\n\\n"},{"name":"Skeleton.tsx","path":"apps/web/src/components/common/Skeleton.tsx","area":"FRONTEND","folder":"COMMON","content":"import React from \'react\';\\r\\n\\r\\ninterface SkeletonProps {\\r\\n className?: string;\\r\\n}\\r\\n\\r\\nexport const Skeleton: React.FC = ({ className }) => {\\r\\n return (\\r\\n
\\r\\n );\\r\\n};\\r\\n\\r\\nexport default Skeleton;\\n\\n"},{"name":"withAuthGuard.tsx","path":"apps/web/src/components/common/withAuthGuard.tsx","area":"FRONTEND","folder":"COMMON","content":"import React, { useEffect, useState } from \'react\';\\r\\nimport { useRouter } from \'next/router\';\\r\\nimport { User, onAuthStateChanged } from \'firebase/auth\';\\r\\nimport { auth } from \'../../services/firebase-client.service\'; \\r\\n\\r\\n// Roles administrativos globales (para referencia)\\r\\nconst ADMIN_ROLES = [\'admin\', \'SuperAdmin\', \'Scheduler\', \'HR_Manager\'];\\r\\n\\r\\n/**\\r\\n * Higher-Order Component para proteger rutas.\\r\\n * @param WrappedComponent El componente de página a proteger.\\r\\n * @param requiredRoles Un solo rol (string) o un array de roles permitidos (string[]).\\r\\n */\\r\\nexport const withAuthGuard = (\\r\\n WrappedComponent: React.ComponentType, \\r\\n requiredRoles: string | string[] = [\'admin\'] // 🛑 FIX: Acepta string o array\\r\\n) => {\\r\\n \\r\\n // Normalizamos a array para facilitar la lógica\\r\\n const rolesArray = Array.isArray(requiredRoles) ? requiredRoles : [requiredRoles];\\r\\n\\r\\n console.log(`[DEBUG GUARD] Roles Requeridos:`, rolesArray);\\r\\n\\r\\n const ComponentWithAuthGuard = (props: any) => {\\r\\n const router = useRouter();\\r\\n const [loading, setLoading] = useState(true);\\r\\n const [currentUser, setCurrentUser] = useState(null);\\r\\n\\r\\n useEffect(() => {\\r\\n const unsubscribe = onAuthStateChanged(auth, async (user) => {\\r\\n if (!user) {\\r\\n router.replace(\'/\'); \\r\\n return;\\r\\n }\\r\\n\\r\\n setCurrentUser(user);\\r\\n \\r\\n try {\\r\\n // Forzamos refresh del token para tener los claims actualizados\\r\\n const tokenResult = await user.getIdTokenResult(true);\\r\\n const userRole = tokenResult.claims.role as string;\\r\\n \\r\\n console.log(`[DEBUG GUARD] Usuario: ${user.email} | Rol: ${userRole}`);\\r\\n\\r\\n // 🛑 LÓGICA DE AUTORIZACIÓN CORREGIDA\\r\\n // Verificamos si el rol del usuario está incluido en los roles permitidos\\r\\n const isAuthorized = rolesArray.includes(userRole);\\r\\n\\r\\n if (isAuthorized) {\\r\\n setLoading(false);\\r\\n } else {\\r\\n console.warn(`⛔ [GUARD] Acceso Denegado. Rol \'${userRole}\' no autorizado.`);\\r\\n router.replace(\'/\'); \\r\\n }\\r\\n } catch (error) {\\r\\n console.error(\\"❌ [GUARD] Error validando rol:\\", error);\\r\\n router.replace(\'/\');\\r\\n }\\r\\n });\\r\\n\\r\\n return () => unsubscribe();\\r\\n }, [router]);\\r\\n\\r\\n if (loading) {\\r\\n return (\\r\\n
\\r\\n
\\r\\n

Verificando permisos...

\\r\\n
\\r\\n );\\r\\n }\\r\\n\\r\\n return ;\\r\\n };\\r\\n\\r\\n return ComponentWithAuthGuard;\\r\\n};\\n\\n\\n\\n"},{"name":"employee-dashboard.tsx","path":"apps/web/src/components/employee/employee-dashboard.tsx","area":"FRONTEND","folder":"EMPLOYEE","content":"import React, { useState, useEffect } from \'react\';\\r\\nimport { User } from \'firebase/auth\';\\r\\nimport { getEmployeeShifts, callAuditShift, createAbsence } from \'@/services/firebase-client.service\';\\r\\nimport { IShift } from \'@/common/interfaces/shift.interface\';\\r\\nimport toast from \'react-hot-toast\';\\r\\nimport { getCurrentPosition } from \'@/utils/geolocation\'; \\r\\n\\r\\ninterface EmployeeDashboardProps {\\r\\n currentUser: User; \\r\\n}\\r\\n\\r\\ntype ViewMode = \'day\' | \'week\' | \'month\';\\r\\n\\r\\nexport function EmployeeDashboard({ currentUser }: EmployeeDashboardProps) {\\r\\n const [shifts, setShifts] = useState([]);\\r\\n const [loading, setLoading] = useState(true);\\r\\n const [viewMode, setViewMode] = useState(\'week\');\\r\\n const [auditingId, setAuditingId] = useState(null);\\r\\n const [isAuditing, setIsAuditing] = useState(false);\\r\\n\\r\\n // Estados Modal Ausencia\\r\\n const [absenceModalOpen, setAbsenceModalOpen] = useState(false);\\r\\n const [selectedShiftForAbsence, setSelectedShiftForAbsence] = useState(null);\\r\\n const [absenceReason, setAbsenceReason] = useState(\'\');\\r\\n\\r\\n // --- 🛠️ HELPER DE FECHAS (El corazón del arreglo) ---\\r\\n // Convierte Timestamp, {seconds...}, String o Date a un objeto Date válido de JS\\r\\n const getDateObj = (timestamp: any): Date => {\\r\\n if (!timestamp) return new Date();\\r\\n // Caso 1: Firestore Timestamp (tiene .toDate())\\r\\n if (typeof timestamp.toDate === \'function\') return timestamp.toDate();\\r\\n // Caso 2: Objeto Date nativo\\r\\n if (timestamp instanceof Date) return timestamp;\\r\\n // Caso 3: Objeto serializado { seconds, nanoseconds }\\r\\n if (timestamp.seconds !== undefined) return new Date(timestamp.seconds * 1000);\\r\\n // Caso 4: String ISO\\r\\n if (typeof timestamp === \'string\') return new Date(timestamp);\\r\\n \\r\\n return new Date(); // Fallback\\r\\n };\\r\\n\\r\\n // --- Carga de Datos ---\\r\\n const loadShifts = async () => {\\r\\n setLoading(true);\\r\\n try {\\r\\n const data = await getEmployeeShifts(currentUser.uid);\\r\\n // Ordenamos cronológicamente\\r\\n const sorted = data.sort((a, b) => {\\r\\n return getDateObj(a.startTime).getTime() - getDateObj(b.startTime).getTime();\\r\\n });\\r\\n setShifts(sorted);\\r\\n } catch (err: any) {\\r\\n console.error(err);\\r\\n toast.error(\\"Error al cargar agenda.\\");\\r\\n } finally {\\r\\n setLoading(false);\\r\\n }\\r\\n };\\r\\n\\r\\n useEffect(() => { if (currentUser) loadShifts(); }, [currentUser]);\\r\\n\\r\\n // --- Filtros de Tiempo ---\\r\\n const getFilteredShifts = () => {\\r\\n const today = new Date();\\r\\n return shifts.filter(shift => {\\r\\n const date = getDateObj(shift.startTime);\\r\\n \\r\\n if (viewMode === \'day\') {\\r\\n return date.getDate() === today.getDate() && \\r\\n date.getMonth() === today.getMonth() &&\\r\\n date.getFullYear() === today.getFullYear();\\r\\n }\\r\\n if (viewMode === \'week\') {\\r\\n // Lógica simple: Desde hoy hasta 7 días adelante\\r\\n const nextWeek = new Date();\\r\\n nextWeek.setDate(today.getDate() + 7);\\r\\n // Reseteamos horas para comparar días completos\\r\\n const d = new Date(date); d.setHours(0,0,0,0);\\r\\n const t = new Date(today); t.setHours(0,0,0,0);\\r\\n return d >= t && d <= nextWeek;\\r\\n }\\r\\n if (viewMode === \'month\') {\\r\\n return date.getMonth() === today.getMonth() && \\r\\n date.getFullYear() === today.getFullYear();\\r\\n }\\r\\n return true;\\r\\n });\\r\\n };\\r\\n\\r\\n // --- Formateadores Visuales ---\\r\\n const formatTime = (ts: any) => getDateObj(ts).toLocaleTimeString(\'es-AR\', {hour: \'2-digit\', minute:\'2-digit\'});\\r\\n const formatDate = (ts: any) => getDateObj(ts).toLocaleDateString(\'es-AR\', { weekday: \'long\', day: \'numeric\', month: \'long\' });\\r\\n\\r\\n // --- Fichaje (Check-In/Out) ---\\r\\n const handleAuditAction = async (shiftId: string, action: \'CHECK_IN\' | \'CHECK_OUT\') => {\\r\\n if (isAuditing || auditingId) return;\\r\\n \\r\\n setAuditingId(shiftId); \\r\\n setIsAuditing(true);\\r\\n const toastId = toast.loading(action === \'CHECK_IN\' ? \\"Validando ubicación...\\" : \\"Cerrando servicio...\\");\\r\\n\\r\\n try {\\r\\n const coords = await getCurrentPosition();\\r\\n await callAuditShift({ \\r\\n shiftId, \\r\\n action, \\r\\n coords: { latitude: coords.latitude, longitude: coords.longitude } \\r\\n });\\r\\n \\r\\n const msg = action === \'CHECK_IN\' ? \\"✅ ¡Presente registrado!\\" : \\"🏁 ¡Servicio finalizado!\\";\\r\\n toast.success(msg, { id: toastId });\\r\\n await loadShifts(); \\r\\n } catch (error: any) {\\r\\n let msg = \\"Error al procesar.\\";\\r\\n // Mensajes priorizados\\r\\n if (error.message?.includes(\'temprano\')) msg = \\"⏳ Es muy temprano (10 min antes).\\";\\r\\n else if (error.message?.includes(\'cerca\') || error.code === \'functions/failed-precondition\') msg = \\"📍 Estás demasiado lejos.\\";\\r\\n else if (error.message?.includes(\'Permiso\')) msg = \\"⚠️ Activa el GPS.\\";\\r\\n \\r\\n toast.error(msg, { id: toastId, duration: 5000 });\\r\\n } finally {\\r\\n setAuditingId(null); \\r\\n setIsAuditing(false);\\r\\n }\\r\\n };\\r\\n\\r\\n // --- Reporte Ausencia ---\\r\\n const handleReportAbsence = async () => {\\r\\n if (!selectedShiftForAbsence || !absenceReason.trim()) {\\r\\n toast.error(\\"Por favor indique el motivo.\\"); return;\\r\\n }\\r\\n \\r\\n const toastId = toast.loading(\\"Registrando ausencia...\\");\\r\\n try {\\r\\n // 🛑 FIX: Convertimos a Date nativo JS antes de enviar al servicio\\r\\n // Esto evita el error \\"seconds is not valid\\"\\r\\n const start = getDateObj(selectedShiftForAbsence.startTime);\\r\\n const end = getDateObj(selectedShiftForAbsence.endTime);\\r\\n\\r\\n await createAbsence({\\r\\n action: \'CREATE_ABSENCE\',\\r\\n payload: {\\r\\n employeeId: currentUser.uid,\\r\\n employeeName: currentUser.displayName || \'Empleado\',\\r\\n clientId: selectedShiftForAbsence.objectiveId || \'unknown\', \\r\\n type: \'SICK_LEAVE\', // Podríamos agregar un selector de tipo en el modal\\r\\n startDate: start, \\r\\n endDate: end,\\r\\n reason: `[App] ${absenceReason}`\\r\\n }\\r\\n });\\r\\n toast.success(\\"Ausencia reportada correctamente.\\", { id: toastId });\\r\\n setAbsenceModalOpen(false);\\r\\n setAbsenceReason(\'\');\\r\\n // Opcional: Recargar para reflejar cambios si el backend marca el turno\\r\\n await loadShifts();\\r\\n } catch (error: any) {\\r\\n console.error(error);\\r\\n toast.error(\\"Error: \\" + (error.message || \\"Fallo desconocido\\"), { id: toastId });\\r\\n }\\r\\n };\\r\\n\\r\\n // --- Render ---\\r\\n if (loading) return
Cargando agenda...
;\\r\\n\\r\\n const filteredList = getFilteredShifts();\\r\\n // Buscamos el próximo turno relevante para el Header Azul\\r\\n const nextShift = shifts.find(s => s.status === \'Assigned\' || s.status === \'InProgress\');\\r\\n\\r\\n return (\\r\\n
\\r\\n \\r\\n {/* 1. HEADER AZUL (RESTAURADO) */}\\r\\n
\\r\\n
\\r\\n

\\r\\n Hola, {currentUser.displayName?.split(\' \')[0] || \'Colaborador\'}\\r\\n

\\r\\n

Panel de Operaciones

\\r\\n \\r\\n
\\r\\n
\\r\\n

Próximo Turno

\\r\\n

\\r\\n {nextShift ? getDateObj(nextShift.startTime).toLocaleDateString(\'es-AR\', {weekday:\'short\', day:\'numeric\'}) : \'Libre\'}\\r\\n

\\r\\n
\\r\\n
\\r\\n

Estado

\\r\\n

\\r\\n {nextShift?.status === \'InProgress\' ? \\r\\n <> En Servicio : \\r\\n \'Disponible\'}\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n {/* Decoración de fondo */}\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {/* 2. FILTROS (TABS) */}\\r\\n
\\r\\n {([\'day\', \'week\', \'month\'] as ViewMode[]).map(m => (\\r\\n \\r\\n ))}\\r\\n
\\r\\n\\r\\n {/* 3. LISTADO DE TARJETAS */}\\r\\n
\\r\\n {filteredList.length === 0 ? (\\r\\n
\\r\\n 📅\\r\\n

No hay servicios programados.

\\r\\n

Selecciona otro filtro para ver más.

\\r\\n
\\r\\n ) : (\\r\\n filteredList.map((shift) => (\\r\\n
\\r\\n \\r\\n {/* Header Tarjeta */}\\r\\n
\\r\\n
\\r\\n {shift.objectiveName || \'Objetivo\'}\\r\\n {shift.role || \'Vigilador\'}\\r\\n
\\r\\n \\r\\n {shift.status === \'Assigned\' ? \'Pendiente\' : shift.status}\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n {/* Info Tiempo */}\\r\\n
\\r\\n
\\r\\n

Fecha

\\r\\n

{formatDate(shift.startTime)}

\\r\\n
\\r\\n
\\r\\n

Horario

\\r\\n

{formatTime(shift.startTime)} - {formatTime(shift.endTime)}

\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n {/* Botones: PENDIENTE */}\\r\\n {shift.status === \'Assigned\' && (\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n )}\\r\\n\\r\\n {/* Botones: EN CURSO */}\\r\\n {shift.status === \'InProgress\' && (\\r\\n \\r\\n )}\\r\\n \\r\\n {/* Botones: FINALIZADO */}\\r\\n {shift.status === \'Completed\' && (\\r\\n
\\r\\n \\r\\n Servicio Completado\\r\\n
\\r\\n )}\\r\\n
\\r\\n
\\r\\n
\\r\\n ))\\r\\n )}\\r\\n
\\r\\n\\r\\n {/* MODAL DE AUSENCIA */}\\r\\n {absenceModalOpen && (\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n

Reportar Ausencia

\\r\\n
\\r\\n \\r\\n

\\r\\n ¿Por qué no podrás asistir al turno en {selectedShiftForAbsence?.objectiveName}?\\r\\n

\\r\\n \\r\\n